# Get a job
Source: https://docs.file.ai/api-reference/endpoint/get-a-job

> Returns the job's current status, for any v2 operation — this is what

get /prod/v2/jobs/{job_id}

Returns the job's current status, for any v2 operation — this is what
the poll_url on an accepted submission points at.

Two kinds of job share this route, told apart by `kind`:

- `extraction` (a `job_...` id) — a document operation. Settles to
  succeeded or failed, and carries usage.
- `agent` (a `sajob_...` id) — a question asked of the agent. Settles to
  COMPLETED, FAILED or STOPPED, and carries the answer.

The two report different statuses and different results, so branch on
`kind` before reading the rest. Poll until the status is a settled one;
a settled job never changes again — with one exception. An `agent` job
that is FAILED with `error.code: "SUPERAGENT_RUN_STALE"` was abandoned
because it went quiet, not because the agent reported a failure, and it
can still resolve to COMPLETED or STOPPED if the run was only slow.
