Retrieve Batch

Retrieve the current state of a batch job, forcing a live status refresh.

Retrieve the current state of a batch job. Unlike List batches, this forces a live status check - poll this endpoint until status is completed, failed, expired, or cancelled.

GET /v1/batches/:batch_id

Path parameters

batch_idstringrequired

The id of the batch.

Response

idstringoptional
object'batch'optional
endpointstringoptional
input_file_idstringoptional
completion_windowstringoptional
statusstringoptional

One of validating, in_progress, finalizing, completed, failed, expired, cancelling, cancelled.

output_file_idstring | nulloptional

Set once results are ready. Download with GET /v1/files/:file_id/content.

error_file_idstring | nulloptional

Set when one or more lines failed.

errorsobject | nulloptional

Why the batch failed, when it did: { object: 'list', data: [{ code, message, param, line }] }. Only message is filled in. null when there is no batch-level error.

request_countsobjectoptional

{ total, completed, failed }.

metadataobject | nulloptional
created_atintegeroptional
in_progress_atinteger | nulloptional
finalizing_atinteger | nulloptional
completed_atinteger | nulloptional
failed_atinteger | nulloptional
expired_atinteger | nulloptional
cancelled_atinteger | nulloptional
expires_atinteger | nulloptional

Polling recommendation

Poll every 30-60 seconds. Once output_file_id is set, the batch is billed automatically (at the 50% discount) and results become available via the Files API.

Errors

StatusReason
404Batch not found or belongs to another workspace.