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

# Lyzr Agent Session Retrieval

> Retrieves a list of all session IDs that have been created for the specified agent ID.



## OpenAPI

````yaml get /agent/{agent_id}/sessions
openapi: 3.0.3
info:
  title: Lyzr Agent Session Retrieval
  version: 1.0.0
  description: >-
    API endpoint to retrieve all active and historical session IDs associated
    with a specific agent.
servers:
  - url: https://agent-dev.test.studio.lyzr.ai/v1
security: []
paths:
  /agent/{agent_id}/sessions:
    get:
      summary: Get Sessions Endpoint By Agent Endpoint
      description: >-
        Retrieves a list of all session IDs that have been created for the
        specified agent ID.
      operationId: getSessionsByAgent
      parameters:
        - name: agent_id
          in: path
          required: true
          description: The unique identifier of the agent.
          schema:
            type: string
            example: '123444544354'
      responses:
        '200':
          description: Session IDs successfully retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessions:
                    type: array
                    description: A list of session identifiers (IDs).
                    items:
                      type: string
                    example:
                      - session_abc_123
                      - session_xyz_456
        '422':
          description: Validation Error (e.g., incorrect path parameter format).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        loc:
                          type: array
                          items:
                            oneOf:
                              - type: string
                              - type: integer
                        msg:
                          type: string
                        type:
                          type: string
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````