POST /v1/documents is processed asynchronously. The API returns 202 Accepted immediately with a document object; the actual extraction happens in the background. This guide explains the status lifecycle and the three consumption modes.
Status lifecycle
A document moves through the following states:
Terminal states are
completed, partially_completed, failed, and deleted. Once a document reaches a terminal state it does not change again.
Consumption modes
1. Webhook push (recommended for production)
Register a URL once; Folio calls it whenever a document reaches a terminal state.POST with the event payload. No polling required. See Webhooks for signature verification and event types.
Best for: production integrations, high volume, latency-sensitive pipelines.
2. Long-poll (?wait=<seconds>)
Pass ?wait=<seconds> on GET /v1/documents/{id}. The server holds the HTTP connection open until the document leaves queued/processing, or the timeout expires (whichever comes first). The response is the updated document object.
wait=0 (the default) is an immediate poll with no hold: useful for checking status without blocking.3. Fetch result directly
Once you know (via webhook or poll) that the document is in a terminal state, fetch the full extraction result:409 means the document is not yet in a terminal state. A 200 returns the full result object including extract, tables, review_status, flags, and provenance fields.
Best for: fetching the structured payload after any notification method has confirmed completion.
Choosing a mode
Listing documents
You can list all documents for your organisation usingGET /v1/documents. Supports cursor-based pagination via limit and starting_after, and a status filter: