How it works
Submit calls for jobs and runs return
202 Accepted with the id and a poll_url. poll_url is a URI reference: if it comes back without a scheme and host, resolve it against the host you called.
Polling or callbacks
Polling is the source of truth; a callback is a speed-up. No callback is retried, so a callback your endpoint misses is gone, while the job or upload itself stays readable.- Use a callback to learn about settled work quickly.
- Keep polling as a fallback for anything you have not heard back about.
- Make your handler idempotent: a job or upload can be reported more than once.
- Treat a callback as a prompt to fetch the job or upload with your API key, not as the result itself.
Forensics runs have no callback: poll them.
Uploads
An upload is tracked by itsuploadId. GET /v1/uploads/{uploadId} returns:
Each step has one of these statuses (step names are listed on Processing callbacks):
A ZIP upload returns one entry per extracted file in
files, and answers 207 when some extracted files succeeded and others failed.
The
statuses list is held for 10 minutes after the most recent step. After that it can come back empty. For a finished upload, read each document’s status in files (for example processed or action_required) instead.Document jobs
POST /v1/extract, /v1/split and /v1/classify each take one document and return a job with a job_ id:
kind: "extraction" and one of these statuses:
usage (pages, credits) appears once the job has settled, and client_ref echoes the value you submitted. See Extract, split and classify for request fields and result shapes.
To get a callback, send callback_url with the request. The API key’s default callback URL is not used for document jobs; agent jobs use only that default.
Agent jobs
Each question asked in an agent session is a job with asajob_ id, polled on the same GET /v1/jobs/{job_id} route. It returns kind: "agent" and uppercase statuses:
GET /v1/jobs/{job_id} serves both kinds. Branch on kind before reading anything else: the statuses and result differ.
Forensics runs
A fileForensics run checks a file that is already stored in your workspace. It is not a job: it does not appear onGET /v1/jobs/{job_id}, and it has no callback.
A run that is stuck can be re-run with
POST /v1/forensics/runs/{run_id}/retry, which returns a new run_id to poll. GET /v1/forensics/files/{file_id} returns the newest run for a file, including runs started at upload. See Run status for details.
Callbacks
Document and agent job callbacks share one shape, mirroring what polling returns:
Delivery is a single
POST with Content-Type: application/json and a 10-second timeout. It is not retried, whatever your endpoint returns.
Job callbacks may carry
X-Signature and X-Timestamp headers. There is no per-key secret you can verify them with yet, so treat every callback as unauthenticated: fetch the job with your API key before acting on it.Related
Processing callbacks
Step-by-step events for uploads.
Extract, split and classify
Submit one document and poll its job.
Agent sessions
Ask questions and poll
sajob_ jobs.Idempotent requests
Retry submits without creating duplicate work.