Skip to content
API v1 · 1.0.0-draft.1
Go to console
Contents ↓

API reference / Batches

POST

Add files to a batch

POST /v1/batches/{batch_id}/documents

Add files to an open batch (up to 50 files and 200 MB per request)

Parameters

batch_idstringpathrequired
Idempotency-Keystringheaderoptional
Unique string (UUID recommended), kept 24 hours per API key. Same key + same body returns the stored response with Idempotent-Replayed: true. Same key + different body returns 422 idempotency_conflict. Same key while the first request is still running returns 409 idempotency_in_progress. (draft-ietf-httpapi-idempotency-key-header-08)
Sandbox-Scenarioenumheaderoptional
Only with er_test_ keys. Selects the fixed sample outcome. Ignored (and rejected with 400) on live keys.

Request body

multipart/form-data

filesstring[]required
metadataobjectoptional
Up to 20 string pairs (key ≤ 40, value ≤ 500 chars). Do not put personal data here.
document_typeenumoptional
Optional hint applied to every file in this request; overrides the batch's document_type for these files. If the detected type differs, the detected type wins (same as POST /v1/documents). Send it for images, which have no text layer to detect the type from.

Possible errors

400invalid_requestThe request is invalid; see details.
402insufficient_creditYour credit balance is too low. Please top up.
403forbiddenThis key isn't allowed to do this.
404not_foundNot found.
409invalid_stateThis action isn't possible in the current state.
409idempotency_in_progressThe same request is still in progress; retry shortly.
409result_not_readyThe result isn't ready yet.
413file_too_largeThe file is too large. Split the document and upload the parts.
429rate_limitedToo many requests. Retry shortly.
429daily_rejection_limitToo many rejected documents today. Try again tomorrow.
429daily_limit_reachedYour daily processing limit is reached. Try again tomorrow.
429free_failure_limitToo many documents could not be processed today. Try again tomorrow.
429reprocess_limit_reachedThis document was already reprocessed today. Try again tomorrow.
Last updated: 23 Nov 2026