About this endpoint
What it does
Uploads a document via a presigned URL and returns its extracted content as per-unit Markdown, along with metadata and diagnostics about the extraction process.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| filename | String | No | Optional. Used only as an extension hint for plain-text containers (.csv, .tsv, .md) and image naming. |
| mime_type | String | No | MIME type hint. Never trusted — routing uses the type detected from content. |
| presigned_url | String | Yes | S3 presigned GET URL (or any http/https URL). Fetched as-is; may exceed 2,048 characters. Never logged. |
Response
Returns a JSON object with a data object field. data contains units, metadata, and diagnostics; units is an array of content units in document order, metadata describes the extraction engine and detected MIME type, and diagnostics reports OCR/image processing counters.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | Yes | Container for the extraction result. Includes units, metadata, and diagnostics. |
| data.units | Object Array | Yes | The whole content contract, in document order. Join markdown in order for the full document. Each unit includes index, kind, label, route, language, markdown, and warnings. |
| data.units[].index | Integer | Yes | Contiguous 1-based position; maps to chunk page_number. |
| data.units[].kind | ENUM | Yes | Allowed values: page, sheet, slide, image, section. |
| data.units[].label | String | Yes | Page N, Slide N, sheet name, section heading, Preamble, Document, or CSV row range. |
| data.units[].route | ENUM | Yes | Allowed values: native, ocr, mixed_ocr, native_plus_embedded_ocr, blank. A unit with empty Markdown is always blank. |
| data.units[].language | String | Yes | ISO 639-1 code detected per unit; und when undetermined. |
| data.units[].markdown | String | Yes | Unit content. Tables are returned as Markdown tables; embedded image text appears as > [Image text: …] at its anchor. |
| data.units[].warnings | String Array | Yes | Stable snake_case codes such as hidden_sheet, hidden_rows, hidden_slide, table_split_into_blocks, embedded_image_ocr_failed, ocr_fallback_used, ocr_failed_text_layer_used, ocr_attempted_no_content, ocr_not_attempted. |
| data.metadata | Object | Yes | Extraction metadata. Includes detected_mime_type and model. |
| data.metadata.model | String | Yes | Extraction engine/model identifiers joined with +; output is deterministic per value. |
| data.metadata.detected_mime_type | String | Yes | Type detected from content; may differ from the mime_type hint. |
| data.diagnostics | Object | Yes | Always present diagnostic counters for OCR and embedded image handling. |
| data.diagnostics.ocr_attempted | Boolean | Yes | Indicates whether OCR was attempted. |
| data.diagnostics.embedded_images_total | Integer | Yes | Total embedded images processed or skipped. |
| data.diagnostics.embedded_images_ocrd | Integer | Yes | Count of embedded images OCR’d. |
| data.diagnostics.embedded_images_skipped_decorative | Integer | Yes | Count of embedded images skipped because they were decorative. |
Notes
data.diagnostics is always present, and embedded_images_total follows the relationship embedded_images_total = embedded_images_ocrd + embedded_images_skipped_decorative + failed; any failed embedded-image OCR is also reported on the relevant unit with the embedded_image_ocr_failed warning.



