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

API reference / Documents

POST

Create a document

POST /v1/documents

Upload a single document

Parameters

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)
Preferstringheaderoptional
wait=N (RFC 7240), N between 1 and 30. Ignored for files over 10 pages and for batches.
Accept-Languagestringheaderoptional
tr (default) or en. Affects message, title, detail, hint only; codes never change.
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

document_typeenumoptional
Optional hint. If the detected type differs, the detected type wins and a notice is added.
batch_idstringoptional
Add to an open batch (same as POST /v1/batches/{id}/documents with one file).
delivery_modeenumoptional
partial (default): verified fields are released at in_review; fields sent to a human come back with status: needs_review and value: null. When the review ends the result gets a new result_version and document.completed is sent. wait_for_review: result is released only when every field is final.
retention_daysintegeroptional
File retention. 0 = delete file as soon as the result is final. Defaults to the data policy.
outputsstring[]optional
Exports to prepare in advance (links appear in the webhook). All formats remain downloadable later.
duplicate_policyenumoptional
schema_versionstringoptional
Pin a schema version (default: organisation pin, else current).
pipeline_versionstringoptional
Pin a pipeline version (default: organisation pin, else current). A pipeline version pins the exact model ID of every engine; customers never choose or pin engines themselves.
metadataobjectoptional
Up to 20 string pairs (key ≤ 40, value ≤ 500 chars). Do not put personal data here.
filestringrequired
PDF, JPG, PNG, TIFF, UBL-TR XML (e-Fatura / e-Arsiv) or xlsx / legacy xls (bank account statement); max 20 MB and 100 pages, XML max 5 MB. Type is detected from content. An xlsx or xls is never sent to an engine; if no statement reader recognises it or its balance chain fails, every field is needs_review (human_required). XML is read without AI and its XAdES e-seal is verified; XML with a DOCTYPE, entity declarations or external references is rejected with unsafe_xml. No PDF password is accepted; password-protected PDFs are rejected with password_required. ZIP archives are not accepted. HEIC is not accepted in v1; it is rejected with unsupported_type, measured.detected_mime_type set to image/heic, and a hint to upload a JPG or PNG.

Possible errors

400invalid_requestThe request is invalid; see details.
401unauthorizedAuthentication failed. Check your API key.
402insufficient_creditYour credit balance is too low. Please top up.
403forbiddenThis key isn't allowed to do this.
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.
422idempotency_conflictThis Idempotency-Key was used for a different request.
422unsupported_outputThis output format isn't available for this document.
422invalid_requestThe request is invalid; see details.
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.
500internal_errorAn unexpected error occurred.
503service_unavailableThe service is temporarily unavailable.
Last updated: 23 Nov 2026