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

# Exports

> Asynchronous bulk exports with presigned downloads.

**Export jobs** produce bulk extracts of an entity family as a file, asynchronously. Use them for larger single-organization entity extracts, such as full syncs, warehouse loads, and backfills. They do not execute a saved report definition.

Each job is capped at **100,000 rows**. A job whose match count exceeds the cap **fails** (it never silently truncates) with an error telling you to narrow the extract — split large data sets into multiple jobs using the `filters` object (date range, statuses, case types).

## Enqueue

```bash theme={null}
curl -X POST "https://www.presolve.com/api/v1/export-jobs" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "X-Idempotency-Key: 5a1e7c9d-your-unique-key" \
  -H "Content-Type: application/json" \
  -d '{ "entity": "cases", "format": "csv" }'
```

* `entity` is `leads` or `cases`; `format` is `csv`.
* Optional `fields` selects specific columns, and optional `filters` (`startDate`, `endDate`, `statuses`, `caseTypes`) bounds the extract — also the tool for staying under the 100,000-row cap on large data sets.
* Enqueueing is a mutation, so the standard **`X-Idempotency-Key`** header is required. Replaying the same key returns the stored response; reusing a key with a different request body returns `409` with code `IDEMPOTENCY_CONFLICT`.
* The response returns the job with a `queued` status and its `jobId`.

## Track completion

Two ways, pick either (or both):

1. **Event feed** — job completion surfaces as `export_job.completed` (or `export_job.failed`) on [`GET /api/v1/events`](/docs/webhooks/overview). If you already run a cursor loop, this is free.
2. **Polling** — `GET /api/v1/export-jobs/{jobId}` returns the current status; `GET /api/v1/export-jobs` lists your org's jobs.

## Download

Once a job is complete:

```bash theme={null}
curl -L "https://www.presolve.com/api/v1/export-jobs/{jobId}/download" \
  -H "x-api-key: YOUR_API_KEY" -o export.csv
```

The download endpoint responds with a **307 redirect** to a short-lived presigned URL for the finished file — follow the redirect (`-L` in curl) to fetch the CSV. Requesting the download for a job in any non-completed status is an error, not a redirect. Presigned URLs expire quickly, so hit the download endpoint when you are ready to retrieve the file rather than storing the redirect target.

## Notes

* Exports remain single-organization, including for HQ keys with the report hierarchy toggle on. A key sees only its own organization’s data, and `reports:read` is required throughout. The job schema does not accept `organizationIds`; use saved report execution for authorized HQ rollups.
* Export contents pass the same sensitive-field posture as the rest of the API — fields gated behind elevated scopes are not smuggled out through exports.
