Skip to main content
All operations that take more than a moment return a Job resource. Every job-creating route accepts ?wait_seconds= to optionally block for a result.

Job states

Every job flows through these states:

Sync vs async via wait_seconds

The ?wait_seconds= query parameter controls blocking on each job-creating route:
Response codes:
  • 200 — Job reached a terminal state within wait_seconds; full result is inline.
  • 202 — Timeout before completion; poll GET /v1/jobs/{job_id}.
wait_seconds accepts at most 300 seconds. For retained jobs, the deployment’s NDI_MAX_INLINE_WAIT_SECONDS setting may end the wait earlier and answer 202 with the running job; poll GET /v1/jobs/{job_id} either way. Zero-retention jobs are exempt from that deployment cap, except the jobs of a tenant that opted in to the 24 hour result hold, which are capped like retained jobs and can be polled instead. wait_seconds is always a query parameter, never a JSON body field.

Polling

Succeeded:
Failed:

Streaming job events

Subscribe to real-time status transitions instead of polling:
Returns text/event-stream (Server-Sent Events). Each event is a small status update with sequence, at, status, and progress. It is not a full Job. The stream closes when the job reaches a terminal status. Call GET /v1/jobs/{id} to read the full job, including its result or error.

Idempotency

Use the Idempotency-Key HTTP header to make job-creating requests replay-safe:
Behavior:
  • First call — Starts a new job with replayed: false and no Idempotent-Replayed header.
  • Repeated calls with the same key — Returns the original job with replayed: true and the response header Idempotent-Replayed: true, without starting a new job or billing again. Job.credits still reports what the original job cost (or null until its usage is final); do not add that amount to your spend again. A later GET reports replayed: false: the flag describes the response to the submission, not persistent job state.
  • The key is scoped per API key.
  • The key is kept with the job for replay and is never cleared, also after the job’s content is deleted (see Data retention). Do not put personal data in an idempotency key. Use an opaque value such as a UUID or a hash of your own request id.
Idempotency-Key is always an HTTP header, never a JSON body field. Use for:
  • Retrying after a network failure (the same job is returned)
  • CI/CD pipelines (re-running a step is safe)

Workspace creation

POST /v1/workspaces also accepts Idempotency-Key. Both SDKs generate one when omitted. The key is scoped to the API key, tenant and external account. The same key and normalized body replay the original workspace. While an attempt with the key is still running, a retry returns 503 storage_unavailable; retry later with the same key and body rather than a new key. A changed body, a deleted workspace or an attempt abandoned for longer than the cleanup window returns 409 storage_conflict. Keys survive deletion, so use opaque values without personal data.

Listing jobs

Returns a keyset-paginated page (newest first):
Pass ?cursor=<next_cursor> to retrieve the next page. Optional filters: ?status=succeeded, ?kind=parse.

Cancellation

  • Queued or running — Job is marked cancelled.
  • Already terminal — Refused with 409 job_not_cancellable. The job is unchanged; read it with GET /v1/jobs/{id}.
A job cancelled before completion is free: its final credits are 0, including labels or values already delivered by progressive classify or extract. A cancelled job returns no results. GET /v1/jobs/{id} still returns the job, with result: null and result_state: "cancelled". That includes the labels or values a progressive classify or extract published before you cancelled it. For an automatic search, it also covers the job the search delegated to: reading that job by its id returns no result either, even if it finished before the cancel. Reads that serve a result, such as query result rows, grounding rows, QA presentations and filtered-search pages, are refused with 409 job_cancelled. Results you received before the cancel stay with you. No new download links are issued after the cancel. Signed links to customer-workspace document artifacts also check cancellation when opened. Other links issued before the cancel work until they expire.