Use field names that match the document
Field names should be specific and close to the wording in the source document.
Specific field names reduce ambiguity and make the output easier to use downstream.
Write precise field descriptions
Descriptions help the extraction model choose the correct value when a document contains similar fields.
Include units, date meaning, currency expectations, and business context when they matter.
Use enums for known values
Use enum fields when the output should be one of a known set of values. In the schema JSON used by Extract, enum fields can constrain the output to a predefined set of allowed values.Keep schemas simple
Use the simplest structure that matches the data you need. Avoid deep nesting unless the source document actually contains nested information. Deep schemas are harder to maintain and can make extraction less reliable. The examples below show field definitions inside theproperties object, not complete top-level schemas.
Recommended:
Use arrays for repeated data
Use arrays when the document contains repeated values or table rows. The example below shows a field definition inside theproperties object, not a complete top-level schema.
- Invoice line items
- Order lists
- Product lists
- Tables with repeated rows
- Multiple addresses, contacts, or identifiers
Do not ask the schema to calculate new values
The schema should describe values that appear in the source document. Do calculations in your application after extraction. Avoid:Use nullable fields
Use nullable field types when a value may not appear in every document.In current Extract responses, missing values may still appear as empty strings or empty arrays rather than
null, depending on the field and the returned output.Test with representative documents
Test schemas with documents that reflect real production inputs:- Different vendors or document templates
- Scanned and digital documents
- Short and long documents
- Documents with missing fields
- Documents with tables or repeated rows
Iterate on the schema
If extraction quality is poor:- Make field names more specific.
- Add clearer descriptions.
- Use enums for fixed categories.
- Split ambiguous fields into separate fields.
- Simplify nested structures.
- Test with more representative examples.
Related resources
Extract Quickstart
Extract your first document.
Schema Guide
Create extraction schemas.
Response Format
Understand the output.

