What it does
An AI Schema is the list of fields fileAI fills for a kind of document, such as an invoice’sInvoice number, Total amount and Line items table.
fileAI classifies each file into a file type and fills that type’s schema, so every invoice in your project comes back with the same fields in the same shape. See Concepts for how file types, files and documents relate.
When to use it
- You receive the same kinds of documents again and again (invoices, bank statements, contracts) and need the same fields from each, such as a contract’s parties and dates.
- You need to read extracted values into your own system, and correct a wrong value or table cell over the API.
- You already know what a file is and want to skip classification by passing its file type’s
blueprintIdon upload.
How it works
1
Upload
Send the file through Uploads.
2
Classify
fileAI classifies the file. If it matches a file type you already have, fileAI fills that type’s current schema. If it matches nothing, fileAI proposes a new file type with a generated schema (zero-shot: no template or training data needed).
3
Approve new types
You review and approve new types (Verify in the app) or call
PATCH /v1/file-type/approve.4
Read the values
GET /v1/files/{fileId}/values returns the filled fields, grouped by schema.blueprintId when you request the upload (Uploads).
Try it
Read the values extracted from a file. Use afileId from the files[] of GET /v1/uploads/{uploadId}.
Understand the result
Response (200)
For tables with more than 100 rows, pass
includeFullTableData=true to get every row.
Citations are an app feature and are not in the documented response. See Citations and validations.
Next steps
Schema locking
Keep files inside the file types you have approved.
Data types
Field types, formats and how values come back.
Extraction prompts
Write field descriptions that extract reliably.
File Intelligence
Project-wide processing settings and the schema list.
Reference
File types and schemas
A file type (API: blueprint,blueprintId) is a kind of document, such as Invoice. Its schema (schemaId) holds the field definitions. Schemas are versioned: editing one creates a new version, and the file type points at its current version. Concepts defines both terms.
Where field values come from
Edit a schema in the app
1
Open a processed file
Open the file and select the AI Schema tab to see the extracted fields.
2
Adjust fields
Edit a field directly, or click the sparkle icon next to it, describe how the field should be captured, then click Run and Save. Mark fields thumbs up or thumbs down to flag correct and incorrect values.
3
Edit the saved schema
Go to File Intelligence → Extraction Schema and select the schema. Add a table or field, remove one with the trash icon, hide one with the eye icon, or edit one with the pencil icon. Click Save AI schema.
Schema edits are versioned. They apply to newly processed files; existing files keep the version they were processed with until you re-run them with
PATCH /v1/files/schema/rerun.Correct a value
To correct a value, send the form valueid as schemaValueId:
fieldPaths entry sets exactly one of value (a scalar field, addressed by its title) or cells (table cells, addressed by zero-based rowIndex and column title).
File type endpoints
DELETE /v1/file-type returns 200 whenever the request is valid, with deletedCount, failedCount and per-id errors. More than 50 ids is a 422 VALIDATION_FAILED, and nothing is deleted. Duplicate ids are processed once, and an id that is already deleted reports Schema is not found or already deleted, so retries are safe.
Schema endpoints
Each schema carries
blueprintId, schemaType (SYSTEM, CUSTOM or AI), state and usageApprovalState. All list endpoints support pagination, including cursor mode.
PATCH /v1/schemas is deprecated. To change values, use PATCH /v1/files/{fileId}/values.
Values
JSON write endpoints accept an optional
Idempotency-Key header; POST /v1/files/schema/import ignores it. See Idempotency.