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

# Export chats

> Retrieve a paginated list of chats across all agents with optional filters. Use this endpoint for bulk export of chat data.



## OpenAPI

````yaml get /api/export/chats
openapi: 3.1.0
info:
  title: Strada Voice API
  version: 1.0.0
  description: API for managing voice calls
servers:
  - url: https://api.getstrada.com
    description: Production server
security: []
paths:
  /api/export/chats:
    get:
      tags:
        - Export
      summary: Export chats
      description: >-
        Retrieve a paginated list of chats across all agents with optional
        filters. Use this endpoint for bulk export of chat data.
      parameters:
        - name: agentId
          in: query
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
          description: Filter by agent IDs (can pass multiple times)
        - name: createdAtGt
          in: query
          schema:
            type: string
            format: date-time
        - name: createdAtLt
          in: query
          schema:
            type: string
            format: date-time
        - name: pageSize
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 10000
            default: 10000
          description: Number of results per page (max 10000)
        - name: includeTest
          in: query
          schema:
            type: boolean
            default: false
          description: Include test chats
      responses:
        '200':
          description: Successfully retrieved chats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListChatsResponse'
              example:
                chats:
                  - chatId: chat_123abc
                    agentId: agent_456def
                    customerUniqueId: customer_789ghi
                    createdAt: '2024-01-15T10:30:00Z'
                    status: active
                    summary: >-
                      Customer inquired about order status and received tracking
                      information
                    transcript:
                      messages:
                        - role: user
                          content: Hello, I need help with my order
                          createdAt: '2024-01-15T10:30:00Z'
                        - role: bot
                          content: >-
                            I'd be happy to help you with your order. Could you
                            please provide your order number?
                          createdAt: '2024-01-15T10:30:05Z'
                        - role: user
                          content: It's ORD-12345
                          createdAt: '2024-01-15T10:30:20Z'
                        - role: tool
                          toolCallId: call_123abc
                          toolName: getOrderStatus
                          toolArguments: '{"orderId":"ORD-12345"}'
                          toolResult: '{"status":"shipped","trackingNumber":"TRK-789"}'
                          createdAt: '2024-01-15T10:30:25Z'
                        - role: bot
                          content: >-
                            Your order has been shipped! The tracking number is
                            TRK-789.
                          createdAt: '2024-01-15T10:30:30Z'
                        - role: agent
                          content: I can help you further with that
                          agentName: John Smith
                          createdAt: '2024-01-15T10:35:10Z'
                    chatVariables:
                      customerId: '12345'
                      source: website
                metadata:
                  nextPage: https://api.getstrada.com/api/export/chats?pageToken=abc123
        '400':
          description: Bad request - invalid query parameters
        '403':
          description: Forbidden - invalid authentication or authorization
      security:
        - bearerAuth: []
components:
  schemas:
    ListChatsResponse:
      type: object
      properties:
        chats:
          type: array
          items:
            $ref: '#/components/schemas/Chat'
        metadata:
          type: object
          properties:
            nextPage:
              type: string
              description: URL to fetch the next page of results
    Chat:
      type: object
      properties:
        chatId:
          type: string
        agentId:
          type: string
        customerUniqueId:
          type: string
        createdAt:
          type: string
          format: date-time
        handedOffAt:
          type: string
          format: date-time
        terminatedAt:
          type: string
          format: date-time
        abandonedAt:
          type: string
          format: date-time
        summary:
          type: string
        analysis:
          type: object
          additionalProperties: true
        transcript:
          type: object
          properties:
            messages:
              type: array
              items:
                $ref: '#/components/schemas/ChatMessage'
        chatVariables:
          type: object
          additionalProperties: true
        status:
          type: string
          enum:
            - active
            - handedOff
            - terminated
            - abandoned
        csatIsSatisfied:
          type: boolean
          description: Customer satisfaction indicator
        metadata:
          type: object
          additionalProperties: true
          description: Additional metadata associated with the chat
      required:
        - chatId
        - agentId
        - createdAt
        - status
    ChatMessage:
      type: object
      properties:
        role:
          type: string
          enum:
            - bot
            - user
            - tool
            - agent
        content:
          type: string
        createdAt:
          type: string
          format: date-time
        toolCallId:
          type: string
        toolName:
          type: string
        toolArguments:
          type: string
        toolResult:
          type: string
        metadata:
          type: object
          additionalProperties: true
        agentName:
          type: string
        eventType:
          type: string
          enum:
            - zendesk:transfer
            - conversation:join
            - conversation:leave
        userName:
          type: string
      description: >-
        A message in the chat transcript. Can be a user message, bot message,
        tool call, agent message, or Zendesk event. The structure varies based
        on the role.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API Key authentication

````