splitDocumentAsync
Start asynchronous split of a file into typed segments
Split a file that may contain several documents (for example a scanned
bundle of invoices, receipts and cover sheets) into segments by page
range, each with one document type chosen among your candidates or the
implicit otro type. The split does not extract data: crop each segment
and convert it with /api/convert or /api/convert-async.
Supported file formats: PDF (up to 100 pages), JPEG, PNG, GIF, BMP, WebP and single-page TIFF. Convert a multi-page TIFF to PDF first.
Candidates: document_type_code_options is required, with 1 to 20
distinct document type codes accessible to your organization. Do not
include otro: it is implicit and marks pages that match no candidate
(cover sheets, separators, blank pages).
Billing: a successful split counts the pages of the file, like an identification. A failed split is not billed.
Async workflow:
- Submit the file (returns
split_idandstatus_url) - Poll
/api/split-async/status/{id}, or subscribe to theSPLIT_STARTED,SPLIT_COMPLETEDandSPLIT_FAILEDwebhooks - Read
segmentswhen the status isSUCCESS
See the split guide for the segment format, limitations and runnable examples that crop each segment and convert it.
Authorization
ApiKeyAuth Bearer token for API authentication
In: header
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
getSplitStatus GET
Check the status of a split started with `POST /api/split-async` and, when it succeeded, its typed segments. **Segments** cover every page of the file, in order and without gaps. `pages` are 1-based and inclusive. Several documents can share a page (a photo of three receipts, the front and back of an ID card, a document that starts halfway down a page): two consecutive segments can share their border page, and a photo of three receipts gives three segments with `pages: {start: 1, end: 1}`. Pages inside a segment belong to it alone. A segment of type `otro` groups pages or parts that match none of the candidates (cover sheets, separators, blank pages). `confidence_level` is the lowest among the segment parts and `evidence` explains the part that opened it. **Regions (beta)** locate each segment on its pages: one `{page, box: {x0, y0, x1, y1}}` per part, with coordinates from 0 to 1 relative to the page as displayed (PDF rotation and crop box applied, EXIF orientation applied to images), origin at the top-left corner, the same format as `field_locations`. The box has no margin: add 2 % of the page width and height on each side before cropping. A page with a single document that covers it is `{x0: 0, y0: 0, x1: 1, y1: 1}`. `regions` is `null` when no location is known; a page of `pages` without a region in that segment is never shared with another segment, so it can be sent whole. `flags.multiple_documents_on_page` is `true` when a page of the segment has more than one part (more than one region): parts of other documents, or several parts of this same document, such as the front and back of an ID card photographed on one page. **Polling recommendations:** - Poll every 2-3 seconds and stop when the status is `SUCCESS` or `FAILED` - Status endpoints have their own rate limit budget: 10 times your plan's per-minute limit, at least 60 requests per minute. To extract the data of each segment, crop its pages and convert them: see the [split guide](https://docs.docutray.com/docs/guides/split).
createStep POST
Create a Docutray step over the REST API with its name, description, active flag and the document type codes it identifies. Requires the `owner` or `admin` organization role; a `member` receives 403. Every code in `identification.types` must be a document type the organization can access (its own or a published public one), otherwise the request fails with 400 and nothing is created. The internal processing configuration (conversion options, result caching, RAG configs, AI model) is managed by Docutray and cannot be set through this API.