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

# List Sessions

> Retrieve a list of sessions with optional filtering and pagination



## OpenAPI

````yaml GET /sessions/list
openapi: 3.1.0
info:
  title: duohub Retriever API
  description: >-
    Retrieve assisted or non-assisted memory from a duohub knowledge graph. For
    best performance, use the official `duohub` Python package.
  version: 1.0.0
servers:
  - url: https://api.duohub.ai
security:
  - APIKeyHeader: []
paths:
  /sessions/list:
    get:
      tags:
        - Sessions
      summary: List Sessions
      description: Retrieve a list of sessions with optional filtering and pagination
      operationId: listSessions
      parameters:
        - name: customerUserID
          in: query
          required: false
          description: Filter sessions by customer user ID
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Maximum number of sessions to return
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 100
        - name: nextToken
          in: query
          required: false
          description: Token for getting the next page of results
          schema:
            type: string
        - name: previousToken
          in: query
          required: false
          description: Token for getting the previous page of results
          schema:
            type: string
      responses:
        '200':
          description: Sessions retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    type: object
                    properties:
                      sessions:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Session unique identifier
                            userID:
                              type: string
                              description: User ID
                            customerUserID:
                              type: string
                              description: Customer user ID
                              nullable: true
                            metadata:
                              type: array
                              items:
                                type: object
                                properties:
                                  key:
                                    type: string
                                  value:
                                    type: string
                            createdAt:
                              type: string
                              format: date-time
                              description: Creation timestamp
                            updatedAt:
                              type: string
                              format: date-time
                              description: Last update timestamp
                            deletedAt:
                              type: string
                              format: date-time
                              description: Deletion timestamp
                              nullable: true
                            endedAt:
                              type: string
                              format: date-time
                              description: Session end timestamp
                              nullable: true
                      nextToken:
                        type: string
                        description: Token for the next page of results
                        nullable: true
                      previousToken:
                        type: string
                        description: Token for the previous page of results
                        nullable: true
                      count:
                        type: integer
                        description: Number of sessions in the current page
                required:
                  - status
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - bad_request
                required:
                  - error
                  - status
                examples:
                  invalid_json:
                    value:
                      error: Invalid JSON in request body
                      status: bad_request
                  invalid_limit:
                    value:
                      error: Limit must be between 1 and 100
                      status: bad_request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - unauthorized
                required:
                  - error
                  - status
                example:
                  error: API key is required
                  status: unauthorized
        '403':
          description: Forbidden - Invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - forbidden
                required:
                  - error
                  - status
                example:
                  error: Invalid API key
                  status: forbidden
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - error
                required:
                  - error
                  - status
                example:
                  error: Internal server error
                  status: error
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Your duohub API key. Type: str'

````