Extract data from a document
extractTurn uploaded files or URLs into structured JSON using saved, inline, or auto-drafted schemas, with resumable jobs for long-running document processing.
Instructions
One call from a file to structured JSON: uploads a local file or URL (or reuses a document_id), runs a DocuPipe extraction, waits and returns the extracted data. Pass schema_id to reuse a saved schema, json_schema to define the fields inline, or neither to let DocuPipe draft a schema from the document (its schemaId comes back so later calls give the same fields). If it returns status 'processing', call the tool in 'next' to resume; it never uploads or extracts twice. Credits: upload 1/page for PDF, image, Word and HTML (CSV, Excel, JSON, text and XML upload free); extraction 2/page at standard effort, 4/page at high effort, 3/page with citations (always standard effort). Without a schema, drafting one costs 1 credit per page on at most the first 5 pages. Creating a schema from json_schema is free.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public URL of the file to upload, instead of file_path. | |
| save_to | No | Optional path to write the extracted JSON to, relative to the working directory. | |
| citations | No | Cite every value to its place on the page (bounding box and confidence). Runs at standard effort, 3 credits/page. | |
| file_path | No | Local file to upload, relative to the working directory. | |
| schema_id | No | Saved schema to extract with (list_schemas). | |
| guidelines | No | Plain-language extraction instructions. Without a schema they also steer the drafted schema. | |
| document_id | No | An already uploaded document, instead of uploading again. | |
| json_schema | No | Inline JSON Schema (type object, properties with a description each). Saved as a new schema first, free. | |
| schema_name | No | Name for the schema created from json_schema. | |
| effort_level | No | Extraction effort. 'standard' (default) is right for most documents; use 'high' only after standard missed or misread values. | |
| upload_job_id | No | The upload job of document_id, when resuming. | |
| standardization_id | No | Resume: an extraction already started. Requires standardization_job_id. | |
| include_field_metadata | No | Also return per-field page numbers and, with citations, boxes and confidence. | |
| standardization_job_id | No | Resume: the job of standardization_id. |