Skip to main content
POST
Extract structured data from a saved extraction or split

Overview

Pipeline Step 2 or 3 — Schema requires a prior extraction. For split mode, it also requires a prior split. The mode is inferred from the input fields you provide.
Apply a schema to previously extracted documents to get structured data output. This endpoint supports multiple modes, inferred from the input:
  • Single mode — provide extraction_id to apply one schema to a single document
  • Multi-extraction mode — provide a batch extract ID as extraction_id (auto-detected) or an explicit extraction_ids list to combine content from multiple documents and apply the schema to the composite
  • Split mode — provide split_id to apply per-topic schemas to page groups from a prior /split
This endpoint operates on saved extractions (created via /extract with storage enabled, which is the default).
To apply schemas across many extractions or splits at once, use Batch Schema. It supports both single and split modes.

Async Mode

Set async: true to return immediately with a job ID for polling. See Polling for Results for details. Async Response (200):

Mode Reference

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).
This is different from Batch Schema, which applies the same schema to each document independently (one result per document). Use multi-extraction when you need to cross-reference or merge data from multiple source files into a single output.
There are two ways to trigger multi-extraction:
  1. Batch extract auto-detection — Pass a batch extract batch_job_id as extraction_id. The system detects it as a batch parent and automatically combines all completed child extractions.
  2. Explicit list — Pass an extraction_ids array with the specific extraction IDs to combine.
Citations in multi-extraction results use the extraction_id-bb_id format (e.g., abc123-txt-1) to disambiguate bounding boxes across source documents.

Error Responses


Best Practices

Set effort: true for documents with complex layouts, tables, or when initial extraction quality is low.
Add natural language instructions to guide the extraction, especially for ambiguous fields.
If your schema has many fields or the document is large, set async: true to avoid timeouts. See Polling for Results.
First call /split to get page groups, then use this endpoint with split_id + split_schema_config.
When the data you need spans multiple documents, use Batch Extract to extract all files, then pass the batch_job_id as extraction_id to this endpoint. The system auto-detects the batch parent and combines content from all child extractions.

Extract

Extract content from a document

Split Document

Split a document into topic-based page groups

Batch Processing

Apply schema across many documents in parallel

Authorizations

x-api-key
string
header
required

Body

application/json

Request body for schema extraction. Mode is inferred from the input:

  • Provide extraction_id for single-mode or multi-extraction (auto-detected). If the ID belongs to a batch extract, its child extractions are combined automatically.
  • Provide extraction_ids for an explicit list of extractions to combine.
  • Provide split_id + split_schema_config for split-mode extraction.
extraction_id
string<uuid>

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.

extraction_ids
string<uuid>[]

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.

split_id
string<uuid>

ID of saved split (from a prior /split call). Use for split-mode schema extraction.

schema_config
object

Inline schema configuration for single mode. Required (with extraction_id) if schema_config_id is not provided.

schema_config_id
string<uuid>

Reference to a saved schema configuration for single mode. Use this instead of providing schema_config inline.

split_schema_config
object

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.

async
boolean
default:false

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.

Response for single schema extraction mode.

schema_id
string<uuid>
required

Unique identifier for this schema version.

version
integer
required

Version number of this schema for the extraction.

Required range: x >= 1
schema_output
object
required

Extracted values and citations.

extraction_ids
string<uuid>[]

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.

credits_used
number<float> | null

Number of credits consumed by this request. Only present when the organization has the credit billing system enabled.

plan_info
object

Billing tier and cumulative usage information for the calling org, including this schema run.