Skip to main content
Illustration of the Extract use case.
Extract takes a document and a JSON Schema, and returns the fields described by the schema as a structured object. You define what you want in the schema, the API finds it in the document: invoices, forms, ID documents, contracts, anything. By default the call is synchronous: you send the request, the API blocks until the extraction is done, and the response comes back with the full result. For larger documents, opt into async mode with options.async = true: you get back a job ID, and you poll until done.
Full request/response schema for POST /api/v3/extract and GET /api/v3/extract/{job_id} lives in the API reference.

When to use Extract

Use Extract when you need machine-readable values out of a document, mapped to fields you’ve named.
Extract applies your schema independently to every page of the document: result.data comes back with one object per page. That makes it ideal for mechanical, repetitive document processing, where each page is a self-contained record (a stack of invoices, a batch of forms, a multi-page table) and you want the same fields pulled from every one.If instead you need a single structured JSON for the whole document (synthesizing information spread across pages into one consolidated object), Extract is the wrong tool. Use the POST /api/v3/search endpoint inside your own agentic loop to retrieve the relevant passages, then have your model generate the structured output from them.

Sync extraction (small documents)

Sync mode handles documents up to 20 MB, 15 pages and returns the full result in one response.
result.data holds one object per page, for example [{"invoice_number": "INV-2025-004", "total": 4750.0, "due_date": "2025-12-01"}, ...]. You can also send a file via multipart/form-data instead of a URL:
In multipart requests, schema arrives as a JSON-encoded string and is decoded server-side.

Extracting from a document you already ingested

If the document is already in the platform, you don’t need to re-upload it. Pass file_id instead of document or a file part (file in the SDK, which also takes a File object), and the API extracts from the stored copy. Get the id from GET /api/v3/files, or from the response of the POST /api/v3/files call that ingested it.
file_id, document, and a multipart file part are mutually exclusive: send exactly one. Sending none returns a 400, and a file_id your API key can’t read returns a 404.

Async extraction (large documents)

For documents up to 100 MB, 1000 pages, set options.async = true. The API returns a 202 Accepted immediately with a job ID. Poll GET /api/v3/extract/{job_id} until status is completed or failed. Recommended cadence: 1 s for the first 10 s, then 5 s, capped at 30 s. The SDK does this for you when you pass wait=True; drop it and call job.poll() yourself if you want to report progress as it runs.

Reading the response

Sync and async responses share the same shape:
result.data is one entry per page, each shaped like your schema. Fields that weren’t found on a given page are null. When the document has more than 15 pages, result.data is paginated: request additional pages with ?page=N on the GET /api/v3/extract/{job_id} endpoint.

Common errors