Skip to navigation

Split Document

View as Markdown

Creates a Split job. Split finds where each document starts and ends in a bundle of pages and returns the child documents, each with its original page numbers and a document_ref you can reuse in other requests. The model finds the boundaries; there is no split method to choose.

Input: send file (PDF, PNG, JPEG or TIFF; repeat the field for up to 10 documents) or upload_ids, plus a JSON request. The request must contain a config object, so send {"config": {}} to use the defaults.

Options: give config.categories to label each child document, config.constraints.must_split_before to force a new document at specific pages, and config.page_ranges to split only some pages.

Processing: the job runs asynchronously. Poll GET /doc-ai/v1/job/{job_id}/status until it is completed, then fetch GET /doc-ai/v1/job/{job_id}/results. completed means processing finished, not that every segment passed review: check each segment’s review_required.

Authentication

api-subscription-keystring
API Key authentication via header

Headers

Idempotency-KeystringOptional

Retry the same submission without creating another job. The same key with the same request returns the original job (idempotency_replayed: true); the same key with a changed request returns 409 IDEMPOTENCY_CONFLICT.

Request

This endpoint expects a multipart form with multiple files.
filefilesOptional

Document file(s): PDF, PNG, JPEG or TIFF. Repeat the part for up to 10 documents with the same config.

upload_idsstringOptional

Comma-separated upload IDs returned by POST /doc-ai/v1/job/upload, with or instead of file.

requestobjectRequired

Response

Job created, with status accepted and the status_url and results_url to use next. When you send several files, the response is a parent job with one child job per file in documents.

job_idstring
The unique identifier of the job. For a batch, the parent job.
statusstring

Initial status, accepted.

status_urlstring
Path to poll for status.
results_urlstring

Path to fetch results from once the job is completed.

run_idstringOptional
The unique identifier of the job run.
idempotency_replayedbooleanOptional

true when the response replays an earlier request with the same Idempotency-Key.

resolved_budgetmap from strings to anyOptional

Limits applied to the job, such as deadline_at and max_model_calls.

resolved_limitsobjectOptional
documentslist of objectsOptional

Batch submissions only: one entry per document, each with its own job.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error