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

# Create export

> Generate a CSV or JSONL file of any size. Returns an export_id you poll until it's ready.

## When you'd use this

When the result set is too big to page through with `/search` -- say,
50,000+ rows. Instead of looping for hours, you ask us to build a
file in the background, then download it from a signed URL.

## Headers

| Header            | Required?   | Description                                                                                                          |
| ----------------- | ----------- | -------------------------------------------------------------------------------------------------------------------- |
| `Authorization`   | yes         | Bearer token.                                                                                                        |
| `Content-Type`    | yes         | `application/json`                                                                                                   |
| `Idempotency-Key` | recommended | Any string you choose. Sending the same key within 24h returns the same `export_id` instead of creating a duplicate. |

## Request body

| Field                    | Type   | Description                      |
| ------------------------ | ------ | -------------------------------- |
| `table` (required)       | string | Which table to export from.      |
| `select` (optional)      | array  | Columns. Use `["*"]` for all.    |
| `filters` (optional)     | object | Same shape as `/search` filters. |
| `format` (optional)      | string | `csv` (default) or `jsonl`.      |
| `compression` (optional) | string | `gzip` (default) or `none`.      |

## Request

```bash theme={null}
curl https://api.trydatadriver.com/v1/exports \
  -H "Authorization: Bearer dd_a3f9b2c1d4e5f6g7h8i9j0" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: az-tier1-2026-05-09" \
  -d '{
    "table": "leads",
    "select": ["*"],
    "filters": {
      "state": { "in": ["AZ"] },
      "tier":  { "eq": 1 },
      "dnc":   { "eq": "N" }
    },
    "format":      "csv",
    "compression": "gzip"
  }'
```

## Response

```json theme={null}
{
  "export_id":  "exp_a3f9b2c1d4e5f6g7",
  "status":     "pending",
  "created_at": "2026-05-09T12:14:00Z",
  "poll_url":   "https://api.trydatadriver.com/v1/exports/exp_a3f9b2c1d4e5f6g7"
}
```

<Note>
  **It's not done yet.** `202 Accepted` means "working on it." Poll
  [`GET /v1/exports/{id}`](/endpoints/get-export) until status becomes
  `completed`.
</Note>

If you sent an `Idempotency-Key` and it matches a recent export, the
response will include `"idempotent_replay": true` and the same
`export_id` as before -- no new export was created.
