About this endpoint
What it does
Extracts a document from the provided URL and returns the content as per-unit Markdown, along with extraction metadata and diagnostics. The request body must include a presigned_url; optional filename and mime_type are used only as hints.
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 (an array of per-unit content objects), metadata (an object with extraction details), and diagnostics (an object with OCR/image-processing counters).
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | Yes | Wrapper object containing the extracted document content and related metadata. |
| 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 | Unit kind. 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 | How the unit was read. 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 rendered as Markdown tables; embedded image text appears as > [Image text: …] at its anchor. |
| data.units[].warnings | String Array | Yes | Stable snake_case warning codes, if any: 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 object. |
| data.metadata.detected_mime_type | String | Yes | Type detected from content; may differ from the mime_type hint. |
| data.metadata.model | String | Yes | Extraction engine/model identifiers joined with +; output is deterministic per value. |
| data.diagnostics | Object | Yes | Always present. OCR and embedded-image diagnostics for the extraction run. |
| data.diagnostics.ocr_attempted | Boolean | Yes | Whether OCR was attempted. |
| data.diagnostics.embedded_images_total | Integer | Yes | Total embedded images encountered. |
| 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 as decorative. |
Notes
data.diagnostics.embedded_images_total is defined as embedded_images_ocrd + embedded_images_skipped_decorative + failed; when an embedded image OCR fails, the corresponding unit is also flagged with embedded_image_ocr_failed in data.units[].warnings.


