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

# Export Calls

> Export calls data in CSV or JSON format.

Returns call data with the specified filters applied (same filter set as GET /).

This endpoint allows you to export a list of calls to either a CSV or JSON file. It supports a subset of the filtering options available on the [List Calls](/api-reference/calls/list) endpoint.

The response from this endpoint will be a file download.

### Query Parameters

* `format` (string, optional, default: `csv`): The desired file format. Can be `csv` or `json`.
* `status` (string, optional): Filter calls by their status.
* `assistant_id` (integer, optional): Filter calls by a specific assistant.
* `customer_phone` (string, optional): Filter by customer phone number.
* `call_sid` (string, optional): Filter by Burki call SID / provider call identifier.
* `assistant_name` (string, optional): Filter by assistant name.
* `date_from` (string, optional): Filter calls from this date (ISO 8601 format).
* `date_to` (string, optional): Filter calls to this date (ISO 8601 format).

Export filters are combined with AND semantics.

### Response

The response is not a JSON object in the traditional sense, but a file that your browser will prompt you to download.

**If `format=csv`:**

You will receive a `text/csv` file named `calls_export.csv`.

```csv CSV Content theme={null}
"Call ID","Call SID","Assistant Name","Customer Phone","Status","Duration (seconds)","Started At","Ended At"
101,"CA...","Support Bot","+1555...","completed",300,"2023-10-30T10:00:00","2023-10-30T10:05:00"
102,"CA...","Sales Rep","+1555...","completed",450,"2023-10-30T11:00:00","2023-10-30T11:07:30"
```

**If `format=json`:**

You will receive an `application/json` file named `calls_export.json` containing an array of call objects.

```json JSON Content theme={null}
[
  {
    "id": 101,
    "call_sid": "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "assistant_name": "Support Bot",
    "customer_phone_number": "+15559876543",
    "status": "completed",
    "duration": 300,
    "started_at": "2023-10-30T10:00:00",
    "ended_at": "2023-10-30T10:05:00"
  }
]
```


## OpenAPI

````yaml GET /api/v1/calls/export
openapi: 3.1.0
info:
  title: Burki
  description: A system that uses AI to answer customer Calls.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/calls/export:
    get:
      tags:
        - calls
      summary: Export Calls
      description: >-
        Export calls data in CSV or JSON format.


        Returns call data with the specified filters applied (same filter set as
        GET /).
      operationId: export_calls_api_v1_calls_export_get
      parameters:
        - name: format
          in: query
          required: false
          schema:
            type: string
            pattern: ^(csv|json)$
            description: 'Export format: csv or json'
            default: csv
            title: Format
          description: 'Export format: csv or json'
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by call status
            title: Status
          description: Filter by call status
        - name: assistant_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Filter by assistant ID
            title: Assistant Id
          description: Filter by assistant ID
        - name: customer_phone
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by customer phone number (substring)
            title: Customer Phone
          description: Filter by customer phone number (substring)
        - name: call_sid
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by call SID (substring)
            title: Call Sid
          description: Filter by call SID (substring)
        - name: assistant_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by assistant name (substring)
            title: Assistant Name
          description: Filter by assistant name (substring)
        - name: date_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter calls from this date
            title: Date From
          description: Filter calls from this date
        - name: date_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter calls to this date
            title: Date To
          description: Filter calls to this date
      responses:
        '200':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````