POST /v1/extract gives you the whole document as structured chunks. Schema extraction is the other direction: you hand us a JSON schema describing the fields you want — invoice_number, total, line_items[] — and get back just those fields, filled from the document, with a citation (page, bounding box, and the verbatim source text) for every value.
Request
POST /v1/extract/schema (JSON body with a url) or POST /v1/extract/schema/file (multipart upload — required for PHI keys). The schema is a standard JSON Schema; descriptions double as per-field hints.
string / number / integer / boolean, object (with properties), array (with items), plus enum and description on leaves. Nesting up to 5 levels. Wide schemas are capped (a few hundred fields) and return 422 with a “split your schema” message — keep schemas focused.
Response
values is your schema, filled (null where the document genuinely lacks a field). evidence is a parallel map keyed by field path — each value’s source page, box (0–1000, page-relative), and verified text.
strict(defaulttrue): a non-null value whose quote can’t be verified is nulled out and listed inungrounded_fields(the safe default — a fabrication never reaches you). Setstrict: falseto keep the value but still see it flagged.bboxis[x0, y0, x1, y1]normalized to 0–1000, page-relative, top-left origin — overlay it directly without fetching page dimensions.