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

# Download image CSV export

> Download every row's result as a single CSV file

Returns the whole image batch as a real downloadable CSV file — one row per generation, with `external_id`, `generation_id`, that row's variables, and `result_image_url`. This is the only way to get per-row detail for a batch through this API — [Get image batch status](/docs/api-reference/image-status/get-image-bulk-job-status) only returns aggregate counts, never inline per-row data.

<Warning>
  This file contains the actual data you submitted — names, `external_id`s, whatever variables you sent — not just placeholder examples. Treat it the same way you'd treat any of your own customer data.
</Warning>

<ParamField path="bulk_job_id" type="string" required>
  Returned from [Generate images](/docs/api-reference/generation/bulk-generate-images).
</ParamField>

<ParamField header="Authorization" type="string" required>
  `Bearer {api_key}`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://dev-backend-ai.truefans.in/api/external/v1/image-bulk-jobs/{bulk_job_id}/export.csv" \
    -H "Authorization: Bearer $TRUEFAN_API_KEY" \
    -O -J
  ```

  ```python Python theme={null}
  import requests

  resp = requests.get(
      f"https://dev-backend-ai.truefans.in/api/external/v1/image-bulk-jobs/{bulk_job_id}/export.csv",
      headers={"Authorization": f"Bearer {api_key}"},
  )
  resp.raise_for_status()
  with open("results.csv", "wb") as f:
      f.write(resp.content)
  ```
</RequestExample>

<ResponseExample>
  ```csv 200 OK theme={null}
  external_id,generation_id,customer_name,city,result_image_url
  usr_9182,f339beb9-305d-4a01-89ef-669b7ec70de3,Anmol,Mumbai,https://assets-studio.truefans.in/editor/.../a.png
  usr_4471,a12c8e21-9f3d-4b6a-8e12-1234567890ab,Rahul,Pune,https://assets-studio.truefans.in/editor/.../b.png
  ```

  ```json 401 Unauthorized theme={null}
  { "error": "API key required" }
  ```

  ```json 404 Not Found — job not found theme={null}
  { "error": "Image bulk job not found" }
  ```

  ```json 404 Not Found — not finished yet theme={null}
  { "error": "Export not ready — bulk job has not finished yet", "status": "processing" }
  ```
</ResponseExample>

<Note>
  Only available once the batch is fully done — check `csv_ready` on [Get image batch status](/docs/api-reference/image-status/get-image-bulk-job-status), or wait for the [`bulk_job.completed` webhook](/docs/guides/webhooks), which only fires once this is already true.
</Note>

## Response

Returned with `Content-Type: text/csv` and `Content-Disposition: attachment` — hitting this URL in a browser, or with `curl -O -J`, downloads a `.csv` file directly rather than returning JSON.

The header row is `external_id`, `generation_id` (TrueFan's own ID for the row — useful for support/debugging), followed by every variable name used anywhere in the batch (a row that didn't use a particular variable has an empty cell there), followed by `result_image_url`.
