DocuTray

getSplitStatus

Check asynchronous split status

GET/api/split-async/status/{id}

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.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token for API authentication

In: header

Path Parameters

id*string

The split_id returned by POST /api/split-async

Response Body

application/json

application/json

application/json

identifyDocumentAsync POST

Identify the document type asynchronously from a provided list of options. **Supported file formats:** - image/jpeg (JPEG) - image/png (PNG) - image/gif (GIF) - image/bmp (BMP) - image/webp (WebP) - application/pdf (PDF) **Size limits:** - Maximum file size: 100MB - URL download timeout: 30 seconds **Request methods:** 1. **multipart/form-data**: Direct file upload 2. **application/json with base64**: Base64-encoded image 3. **application/json with URL**: Image URL for automatic download **Async workflow:** 1. Submit document for identification (returns identification_id) 2. Poll `/api/identify-async/status/{id}` for completion 3. Retrieve identified document type when status is SUCCESS

splitDocumentAsync POST

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:** 1. Submit the file (returns `split_id` and `status_url`) 2. Poll `/api/split-async/status/{id}`, or subscribe to the `SPLIT_STARTED`, `SPLIT_COMPLETED` and `SPLIT_FAILED` webhooks 3. Read `segments` when the status is `SUCCESS` See the [split guide](https://docs.docutray.com/docs/guides/split) for the segment format, limitations and runnable examples that crop each segment and convert it.