curl https://api.zerodrift.ai/api/v3/batches/BATCH_ID/files/xlsx \
-H "x-api-key: YOUR_API_KEY"
{
"api_version": "v3",
"url": "https://example-bucket.s3.amazonaws.com/batch-results/batch_3f2b8c1e9d0a4b7f8e6d5c4b3a291807/results.xlsx?X-Amz-Algorithm=...",
"expires_at": "2026-10-05T13:45:00Z"
}
{
"api_version": "v3",
"error": {
"code": "file_not_found",
"message": "batch 'batch_e511e74dd1ea49ba8c5f4293a68427be' has no xlsx file to download"
}
}
Batches
Download a Batch File
Get a fresh link to a batch result file: JSONL, spreadsheet, audit workbook or PDF report.
GET
/
api
/
v3
/
batches
/
{batch_id}
/
files
/
{kind}
curl https://api.zerodrift.ai/api/v3/batches/BATCH_ID/files/xlsx \
-H "x-api-key: YOUR_API_KEY"
{
"api_version": "v3",
"url": "https://example-bucket.s3.amazonaws.com/batch-results/batch_3f2b8c1e9d0a4b7f8e6d5c4b3a291807/results.xlsx?X-Amz-Algorithm=...",
"expires_at": "2026-10-05T13:45:00Z"
}
{
"api_version": "v3",
"error": {
"code": "file_not_found",
"message": "batch 'batch_e511e74dd1ea49ba8c5f4293a68427be' has no xlsx file to download"
}
}
Returns a link to one of a batch’s files. It’s the same link as
files.{kind} on Get a Batch. Use it when the earlier link has expired. Read-only API keys are allowed.
Path Parameters
Which file:
jsonl: one line per message with itscustom_id,metadataandresult.xlsx: the results as a spreadsheet.workbook: the audit workbook.pdf: the audit report.
workbook and pdf exist once the batch’s report_status is ready.Response
curl https://api.zerodrift.ai/api/v3/batches/BATCH_ID/files/xlsx \
-H "x-api-key: YOUR_API_KEY"
{
"api_version": "v3",
"url": "https://example-bucket.s3.amazonaws.com/batch-results/batch_3f2b8c1e9d0a4b7f8e6d5c4b3a291807/results.xlsx?X-Amz-Algorithm=...",
"expires_at": "2026-10-05T13:45:00Z"
}
{
"api_version": "v3",
"error": {
"code": "file_not_found",
"message": "batch 'batch_e511e74dd1ea49ba8c5f4293a68427be' has no xlsx file to download"
}
}
Errors
| Status | Code | Meaning |
|---|---|---|
400 | invalid_file_kind | kind isn’t jsonl, xlsx, workbook or pdf. |
404 | batch_not_found | No batch with this ID is yours. |
404 | file_not_found | The batch hasn’t ended with results, the file wasn’t built, or it was deleted at files_deleted_at. |

