# Download Batch Enrichment CSV (Recommended)

Download the enriched CSV dataset via a temporary presigned URL. **This is the recommended endpoint for downloading CSV results.**
Compared to the direct download endpoint, this returns a short-lived URL that lets you download the file directly from storage — faster and more reliable for large files.
**Requirements**
- Batch must be in
`finished`
 or
`paused_insufficient_credits`
 status
- Results file must have been generated

**Output format**
- **CSV only**
 — for JSON output, use the direct download endpoint (
`GET /public/v1/enrichment/batch/{batch_id}/`
) with
`?format=json`

**Response**
- `download_url`
 — temporary URL (valid for a limited time)
- `expires_in`
 — seconds until the URL expires
- `expires_at`
 — expiration timestamp

**Error Responses**
Every error response shares the canonical shape `{"error": <message>, "error_code": <slug>, ...}`. Branch programmatically on `error_code` rather than parsing `error`.
- `400 Bad Request`
 (
`error_code: "batch_not_ready"`
) — batch not completed yet; the current status is in
`response_meta.batch_status`
- `400 Bad Request`
 (
`error_code: "no_results"`
) — batch finished but produced no rows
- `400 Bad Request`
 (
`error_code: "results_not_ready"`
) — batch finished but the results file is still being assembled
- `404 Not Found`
 (
`error_code: "batch_not_found"`
) — invalid batch ID or batch does not belong to client
- `503 Service Unavailable`
 (
`error_code: "feature_disabled"`
) — presigned-URL downloads are currently disabled; use the direct download endpoint

**Credits**
- **0 credits**
 (download only)

Endpoint: GET /public/v1/enrichment/batch/{batch_id}/download/
Version: 1.0.0
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http bearer API_KEY

## Path parameters:

  - `batch_id` (string, required)
    Unique batch identifier returned when creating the enrichment batch

## Response 200 fields (application/json):

  - `download_url` (string, required)
    Temporary presigned S3 download URL

  - `filename` (string, required)
    Suggested filename for the download

  - `expires_in` (integer, required)
    URL expiration time in seconds

  - `expires_at` (string, required)
    ISO 8601 timestamp when the URL expires

  - `batch_id` (string, required)
    Unique identifier for the batch enrichment job

  - `total_results` (integer, required)
    Number of enriched results in the file

  - `invalid_records` (integer, required)
    Number of invalid records in the batch

## Response 400:

  - `400` (unknown)
    Bad Request — batch state prevents download.

## Response 400 fields (application/json):

  - `error` (any)
    Human-readable description of what went wrong. Shape varies per endpoint: string on most paths, DRF field-error object on validation paths of creators_api enrich/* and enrichment_batch_api create, list of strings on discovery filter validation. See the per-endpoint example response.
    Example: Insufficient credits.

  - `error_code` (string, required)
    Machine-readable snake_case slug identifying the error class. Stable across API versions; **the only field guaranteed present on every public-API error**. Use for programmatic branching instead of parsing `error`.
    Example: insufficient_credits

  - `message` (string)
    Optional long-form detail sibling to `error`. Present on endpoints that historically returned both a short label and a long explanation (rate limits, polling, batch state, insufficient_credits on resume).
    Example: Poll every 30-60 seconds. Excessive polling results in rate limiting.

  - `retry_after` (integer)
    Seconds the caller should wait before retrying. Present on 429s where the OLD endpoint set it; mirrored in the `Retry-After` HTTP header.
    Example: 60

  - `response_meta` (object)
    Echo of request metadata on a few unwrapped endpoints (notably download_batch_enrichment_csv: batch_id, batch_status). Internal-only on wrapped endpoints; stripped before reaching the client.

  - `available_credits` (number)
    Credits currently available. Present on the 403 insufficient_credits response of `POST /public/v1/enrichment/batch/{id}/resume/`.

  - `required_minimum` (number)
    Minimum credits needed. Pairs with `available_credits`.

  - `current_status` (string)
    Current resource state. Present on 400 responses where the operation requires a different state (e.g. `batch_not_ready`, `batch_not_resumable`).

  - `active_batches` (integer)
    Active batch count when `error_code: batch_limit_reached`.

  - `max_allowed` (integer)
    Per-client batch ceiling. Pairs with `active_batches`.

## Response 401:

  - `401` (unknown)
    Unauthorized — missing or invalid API key.

## Response 403:

  - `403` (unknown)
    Forbidden — caller is not permitted to perform this action.

## Response 403 fields (application/json):

  - `error` (any)
    Human-readable description of what went wrong. Shape varies per endpoint: string on most paths, DRF field-error object on validation paths of creators_api enrich/* and enrichment_batch_api create, list of strings on discovery filter validation. See the per-endpoint example response.
    Example: Insufficient credits.

  - `error_code` (string, required)
    Machine-readable snake_case slug identifying the error class. Stable across API versions; **the only field guaranteed present on every public-API error**. Use for programmatic branching instead of parsing `error`.
    Example: insufficient_credits

  - `message` (string)
    Optional long-form detail sibling to `error`. Present on endpoints that historically returned both a short label and a long explanation (rate limits, polling, batch state, insufficient_credits on resume).
    Example: Poll every 30-60 seconds. Excessive polling results in rate limiting.

  - `retry_after` (integer)
    Seconds the caller should wait before retrying. Present on 429s where the OLD endpoint set it; mirrored in the `Retry-After` HTTP header.
    Example: 60

  - `response_meta` (object)
    Echo of request metadata on a few unwrapped endpoints (notably download_batch_enrichment_csv: batch_id, batch_status). Internal-only on wrapped endpoints; stripped before reaching the client.

  - `available_credits` (number)
    Credits currently available. Present on the 403 insufficient_credits response of `POST /public/v1/enrichment/batch/{id}/resume/`.

  - `required_minimum` (number)
    Minimum credits needed. Pairs with `available_credits`.

  - `current_status` (string)
    Current resource state. Present on 400 responses where the operation requires a different state (e.g. `batch_not_ready`, `batch_not_resumable`).

  - `active_batches` (integer)
    Active batch count when `error_code: batch_limit_reached`.

  - `max_allowed` (integer)
    Per-client batch ceiling. Pairs with `active_batches`.

## Response 404:

  - `404` (unknown)
    Batch not found.

## Response 404 fields (application/json):

  - `error` (any)
    Human-readable description of what went wrong. Shape varies per endpoint: string on most paths, DRF field-error object on validation paths of creators_api enrich/* and enrichment_batch_api create, list of strings on discovery filter validation. See the per-endpoint example response.
    Example: Insufficient credits.

  - `error_code` (string, required)
    Machine-readable snake_case slug identifying the error class. Stable across API versions; **the only field guaranteed present on every public-API error**. Use for programmatic branching instead of parsing `error`.
    Example: insufficient_credits

  - `message` (string)
    Optional long-form detail sibling to `error`. Present on endpoints that historically returned both a short label and a long explanation (rate limits, polling, batch state, insufficient_credits on resume).
    Example: Poll every 30-60 seconds. Excessive polling results in rate limiting.

  - `retry_after` (integer)
    Seconds the caller should wait before retrying. Present on 429s where the OLD endpoint set it; mirrored in the `Retry-After` HTTP header.
    Example: 60

  - `response_meta` (object)
    Echo of request metadata on a few unwrapped endpoints (notably download_batch_enrichment_csv: batch_id, batch_status). Internal-only on wrapped endpoints; stripped before reaching the client.

  - `available_credits` (number)
    Credits currently available. Present on the 403 insufficient_credits response of `POST /public/v1/enrichment/batch/{id}/resume/`.

  - `required_minimum` (number)
    Minimum credits needed. Pairs with `available_credits`.

  - `current_status` (string)
    Current resource state. Present on 400 responses where the operation requires a different state (e.g. `batch_not_ready`, `batch_not_resumable`).

  - `active_batches` (integer)
    Active batch count when `error_code: batch_limit_reached`.

  - `max_allowed` (integer)
    Per-client batch ceiling. Pairs with `active_batches`.

## Response 422:

  - `422` (unknown)
    Unprocessable entity — validation failed.

## Response 429:

  - `429` (unknown)
    Too Many Requests — rate or capacity limit exceeded. Inspect the `Retry-After` header and the `retry_after` body field for the wait time in seconds.

## Response 429 fields (application/json):

  - `error` (any)
    Human-readable description of what went wrong. Shape varies per endpoint: string on most paths, DRF field-error object on validation paths of creators_api enrich/* and enrichment_batch_api create, list of strings on discovery filter validation. See the per-endpoint example response.
    Example: Insufficient credits.

  - `error_code` (string, required)
    Machine-readable snake_case slug identifying the error class. Stable across API versions; **the only field guaranteed present on every public-API error**. Use for programmatic branching instead of parsing `error`.
    Example: insufficient_credits

  - `message` (string)
    Optional long-form detail sibling to `error`. Present on endpoints that historically returned both a short label and a long explanation (rate limits, polling, batch state, insufficient_credits on resume).
    Example: Poll every 30-60 seconds. Excessive polling results in rate limiting.

  - `retry_after` (integer)
    Seconds the caller should wait before retrying. Present on 429s where the OLD endpoint set it; mirrored in the `Retry-After` HTTP header.
    Example: 60

  - `response_meta` (object)
    Echo of request metadata on a few unwrapped endpoints (notably download_batch_enrichment_csv: batch_id, batch_status). Internal-only on wrapped endpoints; stripped before reaching the client.

  - `available_credits` (number)
    Credits currently available. Present on the 403 insufficient_credits response of `POST /public/v1/enrichment/batch/{id}/resume/`.

  - `required_minimum` (number)
    Minimum credits needed. Pairs with `available_credits`.

  - `current_status` (string)
    Current resource state. Present on 400 responses where the operation requires a different state (e.g. `batch_not_ready`, `batch_not_resumable`).

  - `active_batches` (integer)
    Active batch count when `error_code: batch_limit_reached`.

  - `max_allowed` (integer)
    Per-client batch ceiling. Pairs with `active_batches`.

## Response 503:

  - `503` (unknown)
    Service Unavailable — the presigned-URL feature is currently disabled.

## Response 503 fields (application/json):

  - `error` (any)
    Human-readable description of what went wrong. Shape varies per endpoint: string on most paths, DRF field-error object on validation paths of creators_api enrich/* and enrichment_batch_api create, list of strings on discovery filter validation. See the per-endpoint example response.
    Example: Insufficient credits.

  - `error_code` (string, required)
    Machine-readable snake_case slug identifying the error class. Stable across API versions; **the only field guaranteed present on every public-API error**. Use for programmatic branching instead of parsing `error`.
    Example: insufficient_credits

  - `message` (string)
    Optional long-form detail sibling to `error`. Present on endpoints that historically returned both a short label and a long explanation (rate limits, polling, batch state, insufficient_credits on resume).
    Example: Poll every 30-60 seconds. Excessive polling results in rate limiting.

  - `retry_after` (integer)
    Seconds the caller should wait before retrying. Present on 429s where the OLD endpoint set it; mirrored in the `Retry-After` HTTP header.
    Example: 60

  - `response_meta` (object)
    Echo of request metadata on a few unwrapped endpoints (notably download_batch_enrichment_csv: batch_id, batch_status). Internal-only on wrapped endpoints; stripped before reaching the client.

  - `available_credits` (number)
    Credits currently available. Present on the 403 insufficient_credits response of `POST /public/v1/enrichment/batch/{id}/resume/`.

  - `required_minimum` (number)
    Minimum credits needed. Pairs with `available_credits`.

  - `current_status` (string)
    Current resource state. Present on 400 responses where the operation requires a different state (e.g. `batch_not_ready`, `batch_not_resumable`).

  - `active_batches` (integer)
    Active batch count when `error_code: batch_limit_reached`.

  - `max_allowed` (integer)
    Per-client batch ceiling. Pairs with `active_batches`.

