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

# List sessions

> List sessions for the project that owns the API key, newest first. Results are
scoped to that project, not your whole account, so use an API key from each
project whose sessions you want to list. Page forward by passing the previous
response's `response_metadata.next_cursor` back as `cursor`.




## OpenAPI

````yaml api-reference/specs/agents.yaml GET /v1/sessions
openapi: 3.0.3
info:
  title: AssemblyAI Voice Agents API
  description: >
    REST API for creating and managing reusable voice agents. An agent stores
    its

    system prompt, greeting, voice, and tools server-side, so you can deploy the
    same

    agent across the WebSocket API, a browser, or Twilio by referencing its
    `id`. See

    [Create an agent](/voice-agents/voice-agent-api/create-agent)

    for a guided walkthrough.
  version: 1.0.0
  termsOfService: https://www.assemblyai.com/legal/terms-of-service
  contact:
    name: API Support
    email: support@assemblyai.com
    url: https://www.assemblyai.com/docs/
servers:
  - url: https://agents.assemblyai.com
    description: Production server
    x-fern-server-name: Default
security: []
paths:
  /v1/sessions:
    get:
      summary: List sessions
      description: >
        List sessions for the project that owns the API key, newest first.
        Results are

        scoped to that project, not your whole account, so use an API key from
        each

        project whose sessions you want to list. Page forward by passing the
        previous

        response's `response_metadata.next_cursor` back as `cursor`.
      operationId: listSessions
      parameters:
        - name: limit
          in: query
          description: Maximum sessions per page.
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 200
        - name: cursor
          in: query
          description: >-
            Pagination cursor from the previous response's
            `response_metadata.next_cursor`.
          schema:
            type: string
        - name: status
          in: query
          description: Return only sessions with this status.
          schema:
            type: string
        - name: agent_id
          in: query
          description: Return only sessions for this agent.
          schema:
            type: string
      responses:
        '200':
          description: A page of sessions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - apiKey: []
components:
  schemas:
    SessionListResponse:
      type: object
      required:
        - sessions
      properties:
        sessions:
          type: array
          description: Page of sessions, newest first.
          items:
            $ref: '#/components/schemas/SessionListItem'
        has_more:
          type: boolean
          description: >-
            True when more results may be available; fetch the next page with
            `response_metadata.next_cursor`.
          example: true
        response_metadata:
          $ref: '#/components/schemas/ResponseMetadata'
    SessionListItem:
      type: object
      required:
        - id
        - status
      properties:
        id:
          type: string
          description: Unique ID of the session.
          example: sess_9a648a2ab75747a9a597ba046ced3e13
        agent_id:
          type: string
          nullable: true
          description: Agent the session ran with. Null when no stored agent was used.
          example: 7ad24396-b822-4dca-871a-be9cc4781cf9
        status:
          type: string
          description: Lifecycle status of the session, e.g. `completed`.
          example: completed
        public_close_reason:
          type: string
          nullable: true
          description: Why the session ended, when known.
          example: client_end
        duration_seconds:
          type: number
          nullable: true
          description: Session length in seconds. Null while the session is active.
          example: 42.6
        created_at:
          type: string
          format: date-time
          nullable: true
          description: When the session was created.
        ended_at:
          type: string
          format: date-time
          nullable: true
          description: When the session ended. Null while the session is active.
    ResponseMetadata:
      type: object
      properties:
        next_cursor:
          type: string
          description: >-
            Cursor for the next page; pass it back as the `cursor` query
            parameter. Empty string when there are no further results.
          example: c2Vzc185YTY0OGEyYWI3NTc0N2E5
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Error message describing what went wrong.
          example: Unauthorized
  responses:
    Unauthorized:
      description: >-
        Unauthorized. Invalid or missing API key, or the key is not entitled for
        Voice Agents.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your AssemblyAI API key in the `Authorization` header. The raw key works
        directly; a `Bearer ` prefix is also accepted.

````