curl. By the end you’ll have uploaded a document, waited for processing, and fetched a structured JSON result.
All examples use
sk_test_… sandbox keys. Swap in a sk_live_… key when you’re ready for production.Get an API key
API keys are issued per organisation in the Folio dashboard. Each key is prefixed with See Authentication for key types, rotation, and security guidance.
sk_test_ (sandbox) or sk_live_ (production).Set it as an environment variable so you don’t have to paste it into every command:Submit a document
Send the file as multipart/form-data. The only required field is You’ll receive a Save the
file; document_type is recommended when you know it.202 Accepted with a document object:id — you’ll use it in the next steps.Wait for processing
Poll with the When the response comes back with
?wait=<seconds> long-poll parameter. The server holds the connection open until the document moves out of queued/processing, or the timeout expires."status": "completed" you’re ready to fetch the full result. If it returns "status": "processing" before the timeout, wait a moment and poll again.See Async model for a deeper look at the lifecycle and webhook alternatives.Fetch the result
409 means the document isn’t ready yet. A 200 returns the full extraction result:extract carries a confidence score (0–1), a found boolean, the page number, and a bounding-box for UI overlays. review_status: "auto" means the result passed confidence thresholds without needing human review.Next steps
Async model
Webhooks, long-polling, and the full document lifecycle.
Custom schemas
Define exactly which fields Folio should extract from any document type.
Confidence & HITL
Set thresholds that trigger human review for low-confidence extractions.
De-identification
Strip PHI before results leave the pipeline.