descriptions guide the extraction — and NDI returns values matching it, handling parsing, long documents, and repeating data (arrays) internally.
Long documents are processed in content batches well below the model’s context window: scalar fields take the first value the document states; top-level array fields (line items, transactions) are extracted batch-by-batch and concatenated, so long lists don’t get truncated.
| Endpoint | Behavior |
|---|---|
POST /extract | Starts the job and waits for the result (bounded by timeout_seconds). |
POST /extract_async | Starts the job and returns 202 {"job_id": …} immediately. |
Schema rules
NDI accepts a restricted subset of JSON Schema:- The root must be
{"type": "object", "properties": {…}}. - Allowed keywords:
type,properties,items,required,description,enum,title. - Allowed types:
object,array,string,number,integer,boolean,null. - Nesting is limited to 5 levels; at most 100 properties total.
$ref,$defs,anyOf/oneOf/allOf/not, formats, and defaults are not supported — encode such constraints in the fielddescriptioninstead.
422 before the job starts. Fields the document does not contain come back as null (scalars) or [] (arrays) — a required field missing from the document does not fail the job.
Extract never returns partial data silently: a document that exceeds the extraction capacity (~1,300 standard pages) fails with an extract_content_exceeds_limit error rather than truncating — split such files and extract the parts separately.
Request
Sync endpoint only. Max seconds to wait, between 1 and 300.
The document to extract from. Same shape as everywhere else —
source_url
(+ file_name for s3:///https://). See Files & sources.
Supported extensions are the same as parse, plus .md/.mdx.The JSON schema describing what to extract (see the rules above). Write each
field’s
description as if instructing a careful analyst — it directly
drives accuracy.markdown_url from a prior parse of the same file (an s3:// URL
returned by NDI). When present, extract skips its internal parse — faster
and cheaper if you already parsed the document. Ignored for spreadsheets.Up to 128 characters. See Idempotency.
Result
Discriminator — always
"extract".Outcome of the extraction run;
error carries detail on failure.The extracted values, shaped exactly like your schema. Scalars the document
does not contain are
null; arrays with no matches are [].The same content as
data, persisted as a JSON artifact (time-limited
download URL).Document pages processed (
0 for spreadsheets).Spreadsheet sheets processed (
0 for documents).Examples
Result