> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elizaos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Renew Session

> Manually renew a session to extend its expiration time



## OpenAPI

````yaml post /api/messaging/sessions/{sessionId}/renew
openapi: 3.1.0
info:
  title: Eliza OS API
  description: >-
    API documentation for Eliza OS v1.2.0 - A flexible and scalable AI agent
    framework.


    This API is designed to be used with a locally running Eliza instance.
    Endpoints allow for creating,

    managing, and interacting with AI agents through a REST interface.


    The API is organized into the following domains:

    - **System**: System-wide operations and environment management

    - **Agents**: Agent lifecycle and management operations

    - **Memory**: Agent memory and room management

    - **Messaging**: Message handling, channels, and servers

    - **Audio**: Audio processing and speech synthesis

    - **Media**: File upload and media management

    - **TEE**: Trusted Execution Environment operations

    - **WebSocket**: Real-time communication via Socket.IO
  version: 1.2.0
  contact:
    name: Eliza OS Community
    url: https://github.com/elizaos/eliza
servers:
  - url: http://localhost:3000
    description: Local development server
security: []
tags:
  - name: system
    description: System-wide operations and environment management
  - name: agents
    description: Operations for managing AI agents
  - name: memory
    description: Operations for managing agent memories
  - name: rooms
    description: Operations for managing rooms
  - name: messaging
    description: Operations for messages, channels, and servers
  - name: audio
    description: Operations for speech and audio processing
  - name: media
    description: Operations for file uploads and media management
  - name: logs
    description: Operations for accessing system and agent logs
  - name: tee
    description: Trusted Execution Environment operations
  - name: websocket
    description: Real-time WebSocket communication
paths:
  /api/messaging/sessions/{sessionId}/renew:
    post:
      tags:
        - messaging
      summary: Renew a session
      description: >-
        Manually renew a session to extend its expiration time. This is useful
        even if auto-renewal is disabled.
      operationId: renewSession
      parameters:
        - name: sessionId
          in: path
          required: true
          schema:
            type: string
          description: ID of the session to renew
      responses:
        '200':
          description: Session renewed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionInfo'
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Session has expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Cannot renew - maximum duration reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SessionInfo:
      type: object
      description: Complete session information with status and timeout details
      properties:
        sessionId:
          type: string
          description: Unique session identifier
        agentId:
          type: string
          format: uuid
          description: UUID of the agent
        userId:
          type: string
          format: uuid
          description: UUID of the user
        createdAt:
          type: string
          format: date-time
          description: Session creation timestamp
        lastActivity:
          type: string
          format: date-time
          description: Last activity timestamp
        metadata:
          type: object
          description: Session metadata
        expiresAt:
          type: string
          format: date-time
          description: When the session will expire
        timeoutConfig:
          type: object
          description: Current timeout configuration
          properties:
            timeoutMinutes:
              type: integer
              description: Inactivity timeout in minutes
            autoRenew:
              type: boolean
              description: Whether auto-renewal is enabled
            maxDurationMinutes:
              type: integer
              description: Maximum total session duration
            warningThresholdMinutes:
              type: integer
              description: Minutes before expiration to trigger warning
        renewalCount:
          type: integer
          description: Number of times the session has been renewed
        timeRemaining:
          type: integer
          description: Milliseconds until session expiration
        isNearExpiration:
          type: boolean
          description: Whether the session is within the warning threshold
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code
            message:
              type: string
              description: Error message
            details:
              type: string
              description: Detailed error information

````