Schema Extraction
Apply schema extraction to a previously saved extraction. The mode is inferred from the input:
Single mode — Provide extraction_id + schema_config (or
schema_config_id) to apply one schema to the entire document.
Multi-extraction mode — Provide a batch extract ID as extraction_id
(auto-detected) or an explicit extraction_ids list. The content from all
extractions is combined and the schema is applied to the composite. Citations
use extraction_id-bb_id format to disambiguate across source documents.
Split mode — Provide split_id + split_schema_config to apply
different schemas to different page groups from a prior /split call.
Each topic can have its own schema, prompt, and effort setting.
Creates a versioned schema record that can be retrieved later.
Set async: true to return immediately with a job_id for polling.
To apply schemas across many extractions or splits at once, see Batch Schema or the Batch Processing guide.
Overview
- Single mode — provide
extraction_idto apply one schema to a single document - Multi-extraction mode — provide a batch extract ID as
extraction_id(auto-detected) or an explicitextraction_idslist to combine content from multiple documents and apply the schema to the composite - Split mode — provide
split_idto apply per-topic schemas to page groups from a prior/split
/extract with storage enabled, which is the default).Async Mode
Setasync: true to return immediately with a job ID for polling. See Polling for Results for details.
Mode Reference
- Single Mode
- Split Mode
Request
Apply one schema to an entire extraction.Schema Config
Response (200)
Example — Inline Schema
Example — Saved Config Reference
Example Response
Multi-Extraction Mode
Combine content from multiple documents and apply a single schema to the composite, producing one merged result. This is useful when the data you need spans across several files (e.g., a loss summary in one file and exposure data in another).- Batch extract auto-detection — Pass a batch extract
batch_job_idasextraction_id. The system detects it as a batch parent and automatically combines all completed child extractions. - Explicit list — Pass an
extraction_idsarray with the specific extraction IDs to combine.
extraction_id-bb_id format (e.g., abc123-txt-1) to disambiguate bounding boxes across source documents.Error Responses
Best Practices
Use effort mode for complex documents
Use effort mode for complex documents
effort: true for documents with complex layouts, tables, or when initial extraction quality is low.Provide schema_prompt for context
Provide schema_prompt for context
Use async for large schemas
Use async for large schemas
async: true to avoid timeouts. See Polling for Results.For multi-section documents, use split mode
For multi-section documents, use split mode
/split to get page groups, then use this endpoint with split_id + split_schema_config.Combine data from multiple files with multi-extraction
Combine data from multiple files with multi-extraction
batch_job_id as extraction_id to this endpoint. The system auto-detects the batch parent and combines content from all child extractions.Related Endpoints
Extract
Split Document
Batch Processing
Authorizations
Body
Request body for schema extraction. Mode is inferred from the input:
- Provide
extraction_idfor single-mode or multi-extraction (auto-detected). If the ID belongs to a batch extract, its child extractions are combined automatically. - Provide
extraction_idsfor an explicit list of extractions to combine. - Provide
split_id+split_schema_configfor split-mode extraction.
ID of a saved extraction OR a batch extract job. When a batch extract ID is provided, the system auto-detects it and combines all completed child extractions into a single schema application.
Explicit list of extraction IDs to combine. The markdown and bounding boxes from all extractions are merged and the schema is applied to the composite content. Citations use extraction_id-bb_id format to disambiguate across source documents.
ID of saved split (from a prior /split call). Use for split-mode schema extraction.
Inline schema configuration for single mode. Required (with extraction_id) if schema_config_id is not provided.
Reference to a saved schema configuration for single mode. Use this instead of providing schema_config inline.
Per-topic schema configurations for split mode. Keys must match the topic names from the split. Each topic provides either inline schema or schema_config_id.
If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously.
Response
Schema extraction result (when async=false or omitted). Shape depends on the mode used.
- Option 1
- Option 2
Response for single schema extraction mode.
Unique identifier for this schema version.
Version number of this schema for the extraction.
x >= 1Extracted values and citations.
Present when multiple extractions were combined (via batch extract auto-detection or explicit extraction_ids input). Lists all source extraction IDs that contributed to the result.
Number of credits consumed by this request. Only present when the organization has the credit billing system enabled.
Billing tier and cumulative usage information for the calling org, including this schema run.