curl https://transform.unstructured.io/api/v2/extract \
-H "unstructured-api-key: $UNSTRUCTURED_API_KEY" \
-F "input=@document.pdf" \
--form-string 'schema={"type":"object","properties":{"invoice_number":{"type":"string"}},"required":["invoice_number"],"additionalProperties":false}'
{
"id": "7e3f0f72-4f99-4d6f-b42b-00cdaf7d54e6",
"status": "completed",
"profile": "balanced",
"warnings": [],
"markdown": null,
"format_version": "2.0",
"metadata": {
"page_count": 1
},
"extracted_data": [
{
"data": {
"invoice_number": "INV-1001"
}
}
],
"elements": [],
"source": {
"file_id": "invoice-9eb6c914.pdf",
"filename": "invoice.pdf",
"mimetype": "application/pdf",
"expires_at": "2026-09-18T18:34:26Z"
}
}Extract fields from a Parse or document
Extract structured fields from a document or a completed Parse with a schema. Review required inputs, returned values, and pending responses.
curl https://transform.unstructured.io/api/v2/extract \
-H "unstructured-api-key: $UNSTRUCTURED_API_KEY" \
-F "input=@document.pdf" \
--form-string 'schema={"type":"object","properties":{"invoice_number":{"type":"string"}},"required":["invoice_number"],"additionalProperties":false}'
{
"id": "7e3f0f72-4f99-4d6f-b42b-00cdaf7d54e6",
"status": "completed",
"profile": "balanced",
"warnings": [],
"markdown": null,
"format_version": "2.0",
"metadata": {
"page_count": 1
},
"extracted_data": [
{
"data": {
"invoice_number": "INV-1001"
}
}
],
"elements": [],
"source": {
"file_id": "invoice-9eb6c914.pdf",
"filename": "invoice.pdf",
"mimetype": "application/pdf",
"expires_at": "2026-09-18T18:34:26Z"
}
}input and schema. To reuse a completed Parse, send parse_id and schema as JSON instead.
curl https://transform.unstructured.io/api/v2/extract \
-H "unstructured-api-key: $UNSTRUCTURED_API_KEY" \
-F "input=@document.pdf" \
--form-string 'schema={"type":"object","properties":{"invoice_number":{"type":"string"}},"required":["invoice_number"],"additionalProperties":false}'
parse_id to reuse its content.Authorizations
Headers
Wait up to this many seconds for completed extraction.
Body
A parse ID to extract from, and the shape to extract into.
The ID of the parse to extract against. It is not parsed again.
"9eb6c914-02a5-4c5d-8490-a06476946a38"
A JSON Schema. Subject to the same engine constraints as schema on the parse call, so required must list every key in properties, additionalProperties must be false, and the serialized schema is limited to 1,048,576 bytes.
Optional free-text guidance that shapes how extracted fields are filled. Limited to 1,048,576 bytes when encoded as UTF-8.
Response
Fields extracted. Check status for partial success.
Parse operation metadata plus the canonical document, possibly before extraction has finished.
Underlying job id, for support and tracing.
Document processing or terminal status.
processing, completed, completed_with_warnings The effective profile used for raw-document partitioning.
balanced, best Rendered Markdown projection when requested; null when elements are requested.
The document envelope version.
2.0 Public document-level metadata.
Show child attributes
Show child attributes
Completed extraction results are available only after extraction has finished.
Show child attributes
Show child attributes
Public document elements.
Show child attributes
Show child attributes
The associated original uploaded source file, when known.
Show child attributes
Show child attributes
Notes about a result that still succeeded.
Show child attributes
Show child attributes
Was this page helpful?

