Skip to main content
This guide walks through the complete request cycle using 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.
1

Get an API key

API keys are issued per organisation in the Folio dashboard. Each key is prefixed with sk_test_ (sandbox) or sk_live_ (production).Set it as an environment variable so you don’t have to paste it into every command:
See Authentication for key types, rotation, and security guidance.
2

Submit a document

Send the file as multipart/form-data. The only required field is file; document_type is recommended when you know it.
Folio accepts multipart only — there is no base64 or JSON body option for file uploads.
You’ll receive a 202 Accepted with a document object:
Save the id — you’ll use it in the next steps.
3

Wait for processing

Poll with the ?wait=<seconds> long-poll parameter. The server holds the connection open until the document moves out of queued/processing, or the timeout expires.
When the response comes back with "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.
4

Fetch the result

A 409 means the document isn’t ready yet. A 200 returns the full extraction result:
Each field in 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.