# Download Batch Enrichment Results (Direct)

Download the final enriched dataset after processing is complete.
> **Tip:** For CSV downloads, consider using the **recommended** endpoint `GET /public/v1/enrichment/batch/{batch_id}/download/` instead — it returns a presigned URL for faster, more reliable downloads. Use this endpoint if you need **JSON** output or as a fallback.

**Requirements**
- Batch must be in `finished` status
- Results file must have been generated

**Output formats**
- **CSV** (default) — omit `format` or pass `?format=csv`
- **JSON** — pass `?format=json` to receive a JSON array where each object has:
  - `input_value` — the original input (handle or email)
  - `status` — enrichment status for that record
  - `enrichment_data` — the enriched creator data

**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; `current_status` is included in the body
- `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
- `500 Server Error` (`error_code: "service_error"`) — results file could not be retrieved from storage; safe to retry

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

Endpoint: GET /public/v1/enrichment/batch/{batch_id}/
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

## Query parameters:

  - `format` (string)
    Output format. Omit or pass `csv` (default) to receive a CSV file. Pass `json` to receive a JSON array of objects with `input_value`, `status`, and `enrichment_data` fields.

## Response 200:

  - `200` (unknown)
    CSV or JSON file with enriched results depending on the `format` query parameter.

## Response 200 fields (application/json):

  - `input_value` (string)

  - `status` (string)

  - `enrichment_data` (object)

## 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 500:

  - `500` (unknown)
    Server Error — results file could not be retrieved from storage.

## Response 500 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`.

