Extraction
One call in, structured data out.
Extract from a file#
Uploads into a queue (queueId or queue) or an ad-hoc schema (fields). With wait=true (default) blocks until the document settles (up to 100 s) and returns the values; otherwise, or if it has not settled by then, returns 202 with the id to poll.
POST
/api/v2/extractRequires documents:create on the queue it touches.queue-scoped
Body
multipart/form-datafilefilerequired- The document.
queueIdstringqueuestring- Queue slug.
fieldsstring- JSON
FieldDef[]for an ad-hoc schema (see components.schemas.FieldDef). wait"true" | "false"- Default true.
Responses
OK
Request
curl -X POST "https://docuflow.pendral.io/api/v2/extract" \-H "Authorization: Bearer $DOCUFLOW_API_KEY" \-F "file=@invoice.pdf" \-F "queue=invoices"
Response200
{"documentId": "clx9k2m4p0001qh8z3v7d5f2a","status": "received","error": null,"pageCount": 2,"documentType": "invoice","confidence": 0.94,"avgConfidence": 0.91,"values": {},"fields": [{"path": "invoiceTotal","label": "Invoice number","type": "type","value": "1240.00","normalizedValue": "normalizedValue","page": 1,"bbox": {"x": 1,"y": 1,"w": 1,"h": 1},"confidence": 0.94,"status": "status"}],"links": {"app": "app","api": "api"}}