What a schema defines
At minimum, a schema defines:- The output field names
- The expected value type for each field
- A description of what each field means
- Whether nested objects or arrays should be returned
Ways to create a schema
You can create a schema in two ways:- Ask the Document Agent to generate a draft schema from the current document.
- Create or edit the schema JSON locally.
Generate a draft schema with the Document Agent
The fastest way to get started is to ask the Document Agent to generate a draft schema JSON used by Extract for the current document. Typical workflow:1
Open a document
Open a document in the web app.
2
Ask the Document Agent
Ask the Document Agent to generate the schema JSON for the fields you need.
3
Review the schema
Review the proposed schema in the editor.
4
Edit as needed
Edit field names, field types, descriptions, and output order as needed.
5
Run extraction
Run extraction and review the result.
Create or edit a schema manually
If you prefer to define the schema yourself, create or edit the schema JSON locally.1
Write the schema
Write or paste the schema JSON used by Extract.
2
Save the schema
Save the schema as a local JSON file.
3
Include it in the request
Include the schema in your API request.
4
Run extraction
Run extraction and review the result.
5
Revise
Revise field names, types, descriptions, or nesting as needed.
- You already have a schema design from your application.
- You want precise control over field names and output structure.
- You want to refine a generated schema before using it in production.
- You want to manage schemas in code, version control, or internal tooling.
Use the schema in an API request
If you created the schema locally, include the JSON file directly in your API request. If you created the schema in the web app, export it as JSON before reusing it through the API.Schema JSON structure
Object structure
Most extraction schemas use an object at the top level.Common field properties
Individual fields can include additional properties depending on the field type.Field types
The examples in this section show field definitions insideproperties, not complete top-level schemas.
Enum field example
Nullable fields
Use nullable types when a field may be missing:Schema limits
A leaf field is a field that holds a final extracted value rather than nested fields.
Common schema patterns
Each example in this section is a complete top-level schema that you can adapt for your own extraction task.Single value
Use a single field when the value appears once in the document.Multiple values
Use an array when the document may contain multiple values for the same field.Table rows
Use an array of objects when you need repeated rows with the same structure.Nested object
Use nested objects for grouped fields.Field description guidelines
Good descriptions:- Use the wording that appears in the source document when possible.
- Explain what the value means.
- Include units, date formats, or currency expectations when relevant.
- Avoid asking the model to calculate values that are not directly present.
Next steps
Extract Quickstart
Extract your first document.
Response Format
Understand the output.
Best Practices
Improve extraction accuracy.

