What it does
POST /v1/extract, /v1/split and /v1/classify each take a single document in the request and process it asynchronously.
Each returns 202 Accepted with a job_id straight away; you read the result from GET /v1/jobs/{job_id} or receive it by webhook.
When to use it
- You need to pull fields out of one document, with or without your own schema, without setting up schemas or folders in a project:
POST /v1/extract. - You receive one PDF that holds several documents and need to find where each one starts and ends:
POST /v1/split. - You need to identify what kind of document a file is, optionally against your own list of candidate types:
POST /v1/classify.
How it works
1
Submit
Send the document as
multipart/form-data in the file field, with any options as form fields. You get 202 with job_id, status: "queued" and poll_url.2
Poll or wait
Poll
poll_url (GET /v1/jobs/{job_id}) until status is succeeded or failed. Or pass callback_url to receive the extraction.job.settled webhook. Keep polling as a fallback: the job is durable, a webhook delivery may not be. Async jobs covers both.3
Read the result
On
succeeded, read result. On failed, read error.code and error.detail. usage shows the pages and credits the job used.Try it
Split a shipment PDF into two documents:Understand the result
The submit call returns straight away:202 Accepted
job_id: the job to poll. Document jobs have ajob_prefix.poll_url: theGET /v1/jobs/{job_id}URL. It is a URI reference: if it comes back without a scheme and host, resolve it against the host you called.
Illustrative: shape from the API reference
Next steps
Async jobs
Polling and webhooks across fileAI’s async APIs.
fileForensics
Check a stored file for editing and AI generation.
Errors
Problem responses, including 413, 415 and 422.
Extract with AI Schemas
Keep values in a project instead of one-shot jobs.
Reference
Choose an endpoint
Modes
Every option is a form field, so structured options (schema, ranges, schemas) are sent as JSON strings. A blank field counts as omitted.
The fields you send select the mode:
Sending both
custom_instruction and ranges is a 422. Classify has no free-text instruction field.
Classify against two candidate types:
Request
Fields every operation accepts:
Operation-specific fields:
An extraction
schema that is valid JSON but does not match the expected shape is accepted at submit time. The job then settles as failed, with the validation errors in error.detail.Idempotency-Key header. See Idempotency.
Job
GET /v1/jobs/{job_id} returns a document job with kind: "extraction" and a job_ id prefix. Its statuses and fields are listed in Understand the result; Async jobs has the full status table.
Where to read the result:
poll_url is a URI reference. If it comes back without a scheme and host, resolve it against the host you called.
The same route also returns agent jobs (kind: "agent", sajob_ prefix), which use different statuses. Branch on kind first. See Agent sessions.