Get a batch

⚠️
Preview — this feature is being built; the design below is the spec.
GET https://app.syntic.ai/v1/batches/{batch_id}

Return a batch’s status and counts. Poll it every minute or so, or register a webhook for batch.completed and skip polling.

For how this fits into a full workflow, see Batches.

Headers

HeaderRequiredValue
AuthorizationYesBearer <key>: a private inference key (sk_live_...). See Authentication.

Path parameters

ParameterTypeDescription
batch_idstringThe batch id, starting with batch_.

Response

200 OK, Content-Type: application/json

{
  "id": "batch_01JBXF3P8K",
  "object": "batch",
  "status": "in_progress",
  "input_file_id": "file_01JBXF1Z",
  "output_file_id": null,
  "error_file_id": null,
  "request_counts": {
    "total": 5000,
    "succeeded": 3120,
    "failed": 4,
    "canceled": 0
  },
  "created_at": 1791820800,
  "started_at": 1791820860,
  "ends_by": 1791907200,
  "completed_at": null,
  "metadata": {
    "job": "october-tickets"
  }
}
FieldTypeDescription
idstringStarts with batch_.
objectstringAlways batch.
statusstringvalidating, in_progress, canceling, completed, expired, canceled or failed.
input_file_idstring or nullThe input file, or null for an inline batch.
output_file_idstring or nullResults file, set once the batch reaches a final state with any finished lines.
error_file_idstring or nullSet when validation found problems; lists them by line.
request_countsobjecttotal, succeeded, failed and canceled.
created_atintegerUnix seconds.
started_atinteger or nullWhen the first request started.
ends_byintegerThe end of the 24-hour window.
completed_atinteger or nullWhen the batch reached a final state.
metadataobjectYour string pairs, returned unchanged.

Examples

curl -sS https://app.syntic.ai/v1/batches/batch_01JBXF3P8K \
  -H "Authorization: Bearer $SYNTIC_API_KEY"

Errors

Errors use the error envelope and carry a request_id. Codes specific to this operation:

StatustypecodeWhen
404not_found_errorbatch_not_foundUnknown id or another workspace’s batch.
401authentication_errorinvalid_api_keyThe key is missing, unknown, revoked or expired.
429rate_limit_errorrate_limitedToo many requests; wait for Retry-After. See Rate-limit headers.

Collecting results

When status is completed, expired or canceled, download output_file_id with Download file content. Lines arrive in any order; match them by custom_id. Only lines whose result.type is succeeded are billed.

Was this page helpful?