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

# List chats

> List all chat sessions



## OpenAPI

````yaml https://api.getcargo.io/openapi.json get /ai/chats/list
openapi: 3.1.0
info:
  title: Cargo API
  version: 1.0.0
  description: Cargo Platform API v1
servers:
  - url: https://api.getcargo.io/v1
    description: Cargo API
security:
  - bearerAuth: []
paths:
  /ai/chats/list:
    get:
      tags:
        - AI - Chats
      summary: List chats
      description: List all chat sessions
      parameters:
        - in: query
          name: agentUuid
          schema:
            title: Agent UUID
            description: Filter chats by agent identifier.
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          description: Filter chats by agent identifier.
        - in: query
          name: releaseUuid
          schema:
            title: Release UUID
            description: Filter chats by release identifier.
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          description: Filter chats by release identifier.
        - in: query
          name: userUuid
          schema:
            title: User UUID
            description: Filter chats by user identifier.
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          description: Filter chats by user identifier.
        - in: query
          name: triggerType
          schema:
            title: Trigger type
            description: Filter chats by trigger type.
            type: string
            enum:
              - connector
              - draft
              - web_extension
              - app
              - workflow
          description: Filter chats by trigger type.
        - in: query
          name: messageStatuses
          schema:
            title: Message statuses
            description: Filter chats by their last message status.
            type: array
            items:
              type: string
              enum:
                - pending
                - generating
                - success
                - error
                - cancelling
                - cancelled
          description: Filter chats by their last message status.
        - in: query
          name: name
          schema:
            title: Name
            description: Filter chats by name (partial match).
            type: string
          description: Filter chats by name (partial match).
        - in: query
          name: createdAfter
          schema:
            title: Created after
            description: Filter chats created after this ISO date.
            type: string
          description: Filter chats created after this ISO date.
        - in: query
          name: createdBefore
          schema:
            title: Created before
            description: Filter chats created before this ISO date.
            type: string
          description: Filter chats created before this ISO date.
        - in: query
          name: limit
          schema:
            title: Limit
            description: Maximum number of chats to return.
            type: string
          description: Maximum number of chats to return.
        - in: query
          name: offset
          schema:
            title: Offset
            description: Number of chats to skip.
            type: string
          description: Number of chats to skip.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  chats:
                    type: array
                    items:
                      type: object
                      properties:
                        uuid:
                          type: string
                        slug:
                          type: string
                        workspaceUuid:
                          type: string
                        userUuid:
                          anyOf:
                            - type: string
                            - type: 'null'
                        agentUuid:
                          anyOf:
                            - type: string
                            - type: 'null'
                        releaseUuid:
                          anyOf:
                            - type: string
                            - type: 'null'
                        name:
                          anyOf:
                            - type: string
                            - type: 'null'
                        trigger: {}
                        heartbeat:
                          anyOf:
                            - type: object
                              properties:
                                intervalMinutes:
                                  type: integer
                                  exclusiveMinimum: 0
                                  maximum: 9007199254740991
                                maxMessages:
                                  type: integer
                                  exclusiveMinimum: 0
                                  maximum: 9007199254740991
                                prompt:
                                  anyOf:
                                    - type: string
                                      minLength: 1
                                    - type: 'null'
                              required:
                                - intervalMinutes
                                - maxMessages
                                - prompt
                              additionalProperties: false
                            - type: 'null'
                        evaluator:
                          anyOf:
                            - type: object
                              properties:
                                rubric:
                                  type: string
                                  minLength: 1
                                threshold:
                                  type: number
                                  minimum: 0
                                  maximum: 1
                              required:
                                - rubric
                                - threshold
                              additionalProperties: false
                            - type: 'null'
                        activeStreamUuid:
                          anyOf:
                            - type: string
                            - type: 'null'
                        creditsUsedCount:
                          type: number
                        createdAt:
                          type: string
                        updatedAt:
                          type: string
                        deletedAt:
                          anyOf:
                            - type: string
                            - type: 'null'
                        lastMessage:
                          anyOf:
                            - type: object
                              properties:
                                uuid:
                                  type: string
                                workspaceUuid:
                                  type: string
                                agentUuid:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                releaseUuid:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                chatUuid:
                                  type: string
                                userUuid:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                status:
                                  type: string
                                  enum:
                                    - pending
                                    - generating
                                    - success
                                    - error
                                    - cancelling
                                    - cancelled
                                errorMessage:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                type:
                                  type: string
                                  enum:
                                    - user
                                    - assistant
                                createdAt:
                                  type: string
                                updatedAt:
                                  type: string
                                finishedAt:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                deletedAt:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                              required:
                                - uuid
                                - workspaceUuid
                                - agentUuid
                                - releaseUuid
                                - chatUuid
                                - userUuid
                                - status
                                - errorMessage
                                - type
                                - createdAt
                                - updatedAt
                                - finishedAt
                                - deletedAt
                              additionalProperties: false
                            - type: 'null'
                      required:
                        - uuid
                        - slug
                        - workspaceUuid
                        - userUuid
                        - agentUuid
                        - releaseUuid
                        - name
                        - trigger
                        - heartbeat
                        - evaluator
                        - activeStreamUuid
                        - creditsUsedCount
                        - createdAt
                        - updatedAt
                        - deletedAt
                        - lastMessage
                      additionalProperties: false
                    title: Chats
                    description: List of chats.
                required:
                  - chats
                additionalProperties: false
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````