> ## 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.

# List Sessions

> List all active sessions (admin endpoint)



## OpenAPI

````yaml get /api/messaging/sessions
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:
    get:
      tags:
        - messaging
      summary: List all active sessions
      description: Administrative endpoint to list all active sessions in the system
      operationId: listSessions
      responses:
        '200':
          description: Sessions list retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessions:
                    type: array
                    items:
                      $ref: '#/components/schemas/SessionInfo'
                  total:
                    type: integer
                    description: Total number of active sessions
                  stats:
                    type: object
                    properties:
                      totalSessions:
                        type: integer
                      activeSessions:
                        type: integer
                      expiredSessions:
                        type: integer
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

````