Job object immediately. The job moves through a processing pipeline — OCR, extraction, PII detection, and quality scoring — before reaching a terminal state. This page shows you how to track that lifecycle and act on the results in TypeScript.
Job states
| State | Meaning |
|---|---|
queued | Document received; waiting for a processing slot. |
running | Pipeline is actively processing the document. |
completed | All stages finished successfully. |
failed | Pipeline encountered an unrecoverable error. |
Get a job by ID
Retrieve a job you created earlier by passing its ID toclient.jobs.get().
Wait for completion
Calljob.waitUntilDone() to await the job’s terminal state (completed or failed). The SDK polls automatically with exponential back-off — you do not need to write a polling loop yourself.
waitUntilDone() rejects with a JobTimeoutError if the job has not
finished within the SDK’s default timeout (300 seconds). Pass { timeout: 600 }
to extend it for large files.Access extraction results
Once a job iscompleted, read quality and PII data directly from the job object.
Quality grades at a glance
| Grade | Score range | Recommendation |
|---|---|---|
| A | 0.90 – 1.00 | Ready for training or retrieval as-is. |
| B | 0.75 – 0.89 | Good quality; minor cleanup may help. |
| C | 0.50 – 0.74 | Review before including in datasets. |
| D | 0.00 – 0.49 | Low quality; consider re-scanning source. |
List jobs
client.jobs.list() returns a Promise<Job[]> containing your most recent jobs, newest first.
limit and offset for pagination:
Filter by quality grade
Standard array methods work well for filtering:Submit feedback
If an extraction result is wrong or a quality grade is inaccurate, submit feedback to help improve the model:The unique identifier of the job.
"positive" or "negative".A short issue code describing the problem. Common values:
"wrong_fields",
"missed_pii", "incorrect_summary", "poor_extraction".Next steps
Build Datasets
Turn completed jobs into structured, exportable datasets.
API Reference
Full parameter and return-type reference for all job methods.