Skip to main content

Sync Batch

Force a sync with the provider to check for batch results. Useful when you do not want to wait for the hourly automatic poll.

Force an immediate check with the batch provider (Anthropic or Bedrock) for results. By default, batches are polled automatically every hour. Use this endpoint when you need results sooner or want to verify the current provider-side status.

Call sync when you need results before the next hourly poll. A typical pattern is to submit documents in batch mode, wait a few hours, then call sync to check if results are ready. If the batch is still processing, the response reflects the current provider-side status without changing anything.

The response returns the full batch object with updated counts. If results are ready, status transitions to completed and succeeded_count, errored_count, and expired_count are populated. If the batch is still processing on the provider side, status remains submitted and counts stay at zero.

Syncing an accumulating batch has no effect since it has not been submitted to the provider yet. Syncing a completed or cancelled batch is safe but returns the same data. Pair with GET /v1/batches/:id to inspect per-item results after the sync completes.

POST/v1/batches/:id/sync

Response

Response fields

idstringBatch UUID.
statusstringCurrent batch status after sync.
providerstringInference provider.
item_countintegerTotal number of items in the batch.
succeeded_countintegerNumber of items that completed successfully.
errored_countintegerNumber of items that errored.
expired_countintegerNumber of items that expired.
submitted_atstring | nullISO 8601 timestamp when submitted to the provider.
completed_atstring | nullISO 8601 timestamp when the batch completed.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.
links.selfstringURL to this batch.

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "submitted",
  "provider": "anthropic",
  "item_count": 142,
  "succeeded_count": 0,
  "errored_count": 0,
  "expired_count": 0,
  "submitted_at": "2024-10-01T06:00:00.000Z",
  "completed_at": null,
  "error_message": null,
  "created_at": "2024-10-01T05:45:00.000Z",
  "updated_at": "2024-10-01T06:01:00.000Z",
  "links": { "self": "/v1/batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890" }
}

Errors

Error responses

401unauthorizedMissing or invalid API key.
404not_foundNo batch with this ID exists for your organization.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.