Extract Data
Extract structured data from PDF documents using custom schemas
Overview
The/v2/extract endpoint extracts structured data from PDF documents. It supports optional bounding box citations and handles large documents efficiently.
Request
pdf_file or file_url must be provided.pdf_file or file_url must be provided.alpha, beta, gamma, delta.Recommended: gamma (default), the thorough tier. Tiers: alpha (fast), beta (balanced), gamma (thorough), delta (advanced).citation object with precise location data in the source document.true to enable per request.pii_block_severity, no extraction job is created and the endpoint returns HTTP 200 with "status": "pii_blocked" and "blocked": true in the body, so check those fields before polling.detect_pii is enabled: standard (default) or advanced (higher precision).detect_pii is enabled: any, low, medium, or high.Response
PII-Blocked Response
Whendetect_pii is enabled and PII at or above the threshold is found, the endpoint returns HTTP 200 with no job created. Check status and blocked to tell this apart from a normal submission. The reason is "pii_detected" when pii_block_severity is any, or "pii_detected:<severity>" for the other thresholds:
Extraction Results Format
Once the job is completed, the results will contain the extracted data with additional metadata:null when citations are disabled or the value could not be grounded:Example Extraction Results
For a simple financial document schema:Citations
Theenable_citations parameter controls whether bounding box coordinates are returned with extracted data. Citations provide references back to the source document, allowing you to trace where each extracted value was found.
With Citations Enabled
Whenenable_citations is set to True, each extracted field includes a citation object with precise location data (or null when the value could not be grounded):
bbox:[left, top, right, bottom]in PDF point space (origin: top-left)- Standard A4 page = 595 x 842 points
page_width/page_heightincluded for scaling to any display size
Without Citations (Default)
Whenenable_citations is False (default), no grounding pass runs. On the default gamma tier each field still uses the nested shape, with grounding_score: 0.0 and citation: null. On the alpha, beta, and delta tiers the response uses a legacy flat shape instead: {"value": ..., "score": <number>} with no citation key. The nested gamma shape:
enable_citations to True when you need to trace extracted values back to their exact location in the document, such as for UI highlighting or audit trails.JSON Schema Definition
Theschema_data parameter must be a valid JSON Schema that defines the structure of data to extract. All schemas must follow the JSON Schema specification with proper type definitions, properties, and constraints.
Basic Schema Structure
All extraction schemas must include:type: “object” (root level)properties: Object defining the fields to extractrequired: Array of required field namesadditionalProperties: Set toFalsefor strict validation
Financial Document Schema Example
This example demonstrates extracting shareholding patterns and board information from financial documents:Advanced Financial Schema Example
This example shows a more complex schema for extracting detailed shareholding information:Citation Extraction Schema
Legal Document Schema
JSON Schema Field Types
items property defining the type of array elements.properties defining nested structure.["string", "null"]Job Management Integration
After creating an extraction job, you can poll for completion using the job status endpoints:Advanced Schema Patterns
Nested Object Structures
For complex documents with hierarchical data:Array of Complex Objects
For extracting lists of structured data:Error Handling
Authorizations
Body
JSON schema defining the structure and fields to extract from the document. Example: {"type":"object","properties":{"invoice_number":{"type":"string","description":"The invoice number"}},"required":["invoice_number"],"additionalProperties":false}
The PDF file to process for data extraction. Maximum file size: 500MB. Either pdf_file or file_url must be provided.
URL to a PDF file to process. Either pdf_file or file_url must be provided.
Model tier to use for extraction. Options: alpha, beta, gamma (default, recommended), delta
alpha, beta, gamma, delta Return bounding box coordinates for extracted values
Enable an agentic verification and validation layer for higher accuracy/consistency. Extracted values are independently cross-checked against the document and uncertain fields are re-verified and reconciled before the result is returned. Slower. Off by default; set true to enable per request.
Optional name identifying the schema, stored with the job for traceability.
Run a pre-flight PII check before extraction. If PII is found at or above pii_block_severity, no extraction job is created and the endpoint returns HTTP 200 with "status": "pii_blocked" and "blocked": true in the body.
PII detection engine: 'standard' (default) or 'advanced' (higher precision).
standard, advanced Severity threshold that blocks extraction when detect_pii is enabled: 'any', 'low', 'medium', or 'high'.
any, low, medium, high 
