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

# Export calls (CSV)

> Export calls for a voice agent as a CSV file download. Supports the same
filters as the call list. The export is not paginated; all matching calls
are streamed.




## OpenAPI

````yaml /api-reference/agents/agents.oas.yaml get /v1/agents/{agent_id}/calls/export
openapi: 3.0.3
info:
  title: SLNG Voice Agents API
  version: 1.0.0
  description: >
    Public API for managing Voice Agents, dispatching outbound calls, and
    creating web (non-telephony) sessions.


    Base URL: `https://api.agents.slng.ai`
  contact:
    name: SLNG Support
    email: support@slng.ai
servers:
  - url: https://api.agents.slng.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Agents
    description: Voice agent CRUD.
  - name: Versions
    description: Agent configuration version history and restore.
  - name: Calls
    description: Call dispatch and status.
  - name: Sessions
    description: Web (non-telephony) sessions.
paths:
  /v1/agents/{agent_id}/calls/export:
    parameters:
      - $ref: '#/components/parameters/AgentIdPath'
    get:
      tags:
        - Calls
      summary: Export calls (CSV)
      description: >
        Export calls for a voice agent as a CSV file download. Supports the same

        filters as the call list. The export is not paginated; all matching
        calls

        are streamed.
      operationId: exportAgentCalls
      parameters:
        - $ref: '#/components/parameters/CallStatusQuery'
        - $ref: '#/components/parameters/CallChannelQuery'
        - $ref: '#/components/parameters/CallDateFromQuery'
        - $ref: '#/components/parameters/CallDateToQuery'
        - $ref: '#/components/parameters/CallDurationBucketQuery'
      responses:
        '200':
          description: CSV export.
          headers:
            Content-Disposition:
              schema:
                type: string
              description: Attachment filename (`agent-calls-{agent_id}.csv`).
          content:
            text/csv:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    AgentIdPath:
      name: agent_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
      description: Voice agent ID.
    CallStatusQuery:
      name: status
      in: query
      required: false
      schema:
        type: string
        enum:
          - dispatching
          - dispatched
          - in_progress
          - completed
          - failed
      description: Filter calls by status.
    CallChannelQuery:
      name: channel
      in: query
      required: false
      schema:
        type: string
        enum:
          - inbound
          - outbound
          - web
      description: Filter calls by call direction.
    CallDateFromQuery:
      name: date_from
      in: query
      required: false
      schema:
        type: string
        format: date-time
      description: >-
        Filter calls by call_started_at, falling back to created_at, from this
        time.
    CallDateToQuery:
      name: date_to
      in: query
      required: false
      schema:
        type: string
        format: date-time
      description: >-
        Filter calls by call_started_at, falling back to created_at, until this
        time.
    CallDurationBucketQuery:
      name: duration_bucket
      in: query
      required: false
      schema:
        type: string
        enum:
          - none
          - under_1_min
          - 1_to_5_min
          - over_5_min
      description: Filter calls by duration bucket.
  responses:
    UnauthorizedError:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              summary: Authentication failed
              value:
                detail: Authentication is required for this endpoint.
    ForbiddenError:
      description: Forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            forbidden:
              summary: Access denied
              value:
                detail: You do not have access to this resource.
    NotFoundError:
      description: Not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            not-found:
              summary: Resource not found
              value:
                detail: The requested resource was not found.
    ValidationError:
      description: Validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            validation-error:
              summary: Request validation failed
              value:
                detail:
                  - loc:
                      - body
                      - language
                    msg: Input should be a valid string
                    type: string_type
    InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal-server-error:
              summary: Unexpected application error
              value:
                detail: An unexpected internal error occurred.
  schemas:
    UUID:
      type: string
      format: uuid
      example: 550e8400-e29b-41d4-a716-446655440000
    ErrorResponse:
      type: object
      additionalProperties: true
      description: >
        Error payloads can vary depending on where the error is raised (edge
        gateway vs backend).


        Common shapes include:

        - `{ "error": "message" }`

        - `{ "detail": "message" }`

        - `{ "detail": [ { "loc": [...], "msg": "...", "type": "..." } ] }`
        (validation)
      properties:
        error:
          type: string
        detail:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````