Skip to main content
Define the structure you want with JSON Schema. You can omit required and additionalProperties from object schemas. Before extraction, Transform adds each property name to required and sets additionalProperties to false on every object, including nested objects.
For multipart requests, send schema as a JSON string. For a request using parse_id, send it as a JSON object. The Extract guide shows both encodings.

Draft a schema from a CSV or input file

Attach a CSV that describes the fields you need, or a representative input file, to an AI assistant. Ask it to follow the documented schema rules and return JSON only:
Create a JSON Schema for Unstructured Transform’s Extract API from the attached CSV. Use its field names, data types, and descriptions. Follow Transform’s documented schema requirements, do not invent fields or constraints, and ask if anything is unclear. Return only valid JSON.
The ACME Financial Highlights fields CSV was prepared from Parse output for the ACME annual report sample. The matching schema was smoke-tested with direct Extract against the same PDF. Check the schema against a representative file before using it across a directory.

Sample fields CSV

Copy these fields into acme-financial-highlights-fields.csv and attach that file to your AI assistant with the prompt above.
acme-financial-highlights-fields.csv

Add guidance only when needed

The optional prompt field provides instructions for filling your schema, such as how to normalize a date. The schema still defines the returned structure. A prompt does not create a confidence score or guarantee populated citations.

Correct a rejected schema

Parse and direct-document Extract require JSON Schema draft 2020-12. Omit $schema to use that draft. Other declared drafts return HTTP 400 with invalid_schema. Extract using parse_id accepts schemas validated against drafts 6, 7, 2019-09, or 2020-12. The extraction engine can still reject a schema with HTTP 400 and invalid_schema.
  • malformed_schema_json: The schema is not valid JSON. Check quoting and syntax.
  • invalid_schema: The schema is not valid JSON Schema, uses a draft other than 6, 7, 2019-09, or 2020-12, or breaks an extraction constraint. The error detail names the problem.
  • schema_too_large: The schema exceeds the size limit after Transform adds required and additionalProperties. Reduce the schema size.