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

> Returns a paginated list of chat sessions for the organization. Use when orchestrating conversations from code — creating sessions, sending messages, or listing history for an…

# List chat sessions



## OpenAPI

````yaml get /chat/sessions
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /chat/sessions:
    get:
      summary: List chat sessions
      description: >-
        Returns a paginated list of chat sessions for the organization. Supports
        filtering by status, channel, handoff state, and date ranges.
      operationId: listChatSessions
      parameters:
        - schema:
            type: string
          in: query
          name: cursor
          required: false
          description: Pagination cursor to fetch the next set of results
        - schema:
            type: boolean
          in: query
          name: handed_off
          required: false
          description: Filter by handoff status. Use "true" or "false"
        - schema:
            type: string
            enum:
              - open
              - closed_resolved
              - closed_unresolved
          in: query
          name: status
          required: false
          description: Filter by session status (open, closed_resolved, closed_unresolved)
        - schema:
            $ref: '#/components/schemas/SessionChannel'
          in: query
          name: channel_type
          required: false
        - schema:
            type: string
          in: query
          name: created_after
          required: false
          description: Filter sessions created after this ISO 8601 timestamp
        - schema:
            type: string
          in: query
          name: created_before
          required: false
          description: Filter sessions created before this ISO 8601 timestamp
        - schema:
            type: string
          in: query
          name: updated_after
          required: false
          description: Filter sessions updated after this ISO 8601 timestamp
        - schema:
            type: string
          in: query
          name: updated_before
          required: false
          description: Filter sessions updated before this ISO 8601 timestamp
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListChatSessionsOutput'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    SessionChannel:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/SessionChannel'
      type: string
      enum:
        - web
        - email
        - phone_voice
        - slack
        - sms
        - whatsapp
        - instagram
        - messenger
        - api
        - web_voice
    ListChatSessionsOutput:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ListChatSessionsOutput'
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/GetChatSessionOutput'
        next:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - items
        - next
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    GetChatSessionOutput:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/GetChatSessionOutput'
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        status:
          type: string
          enum:
            - open
            - closed_resolved
            - closed_unresolved
        ai_closure_type:
          anyOf:
            - type: string
              enum:
                - assumed_resolved
                - handed_off
                - resolved
            - type: 'null'
        sentiment:
          anyOf:
            - type: string
              enum:
                - angry
                - happy
                - neutral
            - type: 'null'
        channel:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/SessionChannel'
          required:
            - type
          additionalProperties: false
        contact:
          type: object
          properties:
            id:
              type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            email:
              anyOf:
                - type: string
                  format: email
                  pattern: >-
                    ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                - type: 'null'
            phone_number:
              anyOf:
                - type: string
                - type: 'null'
            name:
              anyOf:
                - type: string
                - type: 'null'
            custom_data:
              anyOf:
                - type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: string
                - type: 'null'
            created_at:
              type: string
              description: ISO 8601 timestamp of when the contact was created
            updated_at:
              type: string
              description: ISO 8601 timestamp of when the contact was last updated
            non_verified_name:
              anyOf:
                - type: string
                - type: 'null'
            non_verified_email:
              anyOf:
                - type: string
                - type: 'null'
            non_verified_custom_data:
              anyOf:
                - type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
                - type: 'null'
          required:
            - id
            - email
            - phone_number
            - name
            - custom_data
            - created_at
            - updated_at
            - non_verified_name
            - non_verified_email
            - non_verified_custom_data
          additionalProperties: false
        language:
          type: string
        assignee_id:
          anyOf:
            - type: string
            - type: 'null'
        custom_data:
          description: Session-level custom data stored on the chat session.
          type: object
          propertyNames:
            type: string
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
        team:
          type: object
          properties:
            id:
              type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            name:
              type: string
            description:
              type: string
          required:
            - id
            - name
          additionalProperties: false
        handoff:
          type: object
          properties:
            sentiment:
              type: string
              enum:
                - angry
                - happy
                - neutral
            summary:
              type: string
          required:
            - summary
          additionalProperties: false
        ticketing_system:
          type: object
          properties:
            name:
              type: string
              enum:
                - dynamics365
                - freshchat
                - freshdesk
                - freshdesk_ticketing
                - front
                - gorgias
                - hubspot
                - infobip
                - intercom
                - open
                - salesforce
                - salesforce_v2
                - twilio_flex
                - zendesk
                - zendesk_v2
            external_id:
              type: string
            id_type:
              type: string
              enum:
                - conversation_id
                - ticket_id
                - case_id
                - conversation_sid
          required:
            - name
            - external_id
            - id_type
          additionalProperties: false
        ticket_number:
          type: number
        assist_mode:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - status
        - ai_closure_type
        - sentiment
        - channel
        - ticket_number
        - assist_mode
        - created_at
        - updated_at
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````