Skip to main content
By default Folio infers what to extract from the detected document type. Custom schemas let you declare the exact fields and table columns you need, regardless of document type — and to get typed values with validation flags when extraction results don’t match expectations.

Two ways to supply a schema

Inline extraction_schema

Pass the schema as a JSON string in the extraction_schema multipart form field. The schema is used for that single request only and is not saved.

Saved schema (extraction_schema_id)

Save the schema once with POST /v1/extraction-schemas, then reference it by ID. Saved schemas get a stable schm_… ID that you can reuse across many submissions.
1

Create the schema

Response (201 Created):
2

Reference by ID at submission time

Providing both extraction_schema and extraction_schema_id in the same request returns 422 with code schema_conflict. Use one or the other.

Field spec reference

Each field in fields is a CustomFieldSpec: Each entry in tables is a CustomTableSpec:

Validation flags

When a schema is present, Folio compares extracted values against the spec and adds flags to the result: Both flag types appear in the flags array of the result and also contribute to review_status. See Confidence and HITL for how flags interact with the human-review workflow.

Managing saved schemas

List

Get by ID

Delete (soft)

Deletion is a soft delete — the schema is deactivated and no longer returned in list results, but historical documents that referenced it are unaffected. Attempting to use the ID on a new submission after deletion returns 422.
Saved schemas are immutable once created. To change a schema, create a new one and update your submissions to reference the new ID.