# Get bulk job status

Returns the job envelope. Items are listed by `GET /v1/bulk/{id}/screenshots`.

**Cancelled by the platform.** When the account can no longer spend (its bandwidth
balance is exhausted, or the account is deleted) while items are still pending, ByteKit
cancels the job itself. It then reads `status: cancelled` even though you never called
`DELETE /v1/bulk/{id}`, and the cancellation sends no webhook.

**Job ids from other create routes.** The job is looked up by account only, so the id
of a job created by `POST /v1/scrape/bulk` or `POST /v1/fetch/bulk` is found here too, not
a `404`, with that job's envelope. An id from another account answers `404`.

**GET** `/v1/bulk/{id}`

## Parameters

- `id` (path, string, required)

## Responses

### 200 — Successful response.
- `id`
- `status`
- `total`
- `completed`
- `failed`
- `created_at`
- `completed_at`
- `total_credits_charged`
- `total_billed_bytes`
- `estimated_credits`
- `webhook_url`

### 202 — Bulk job still processing. `routes/bulk.ts` ends the poll handler with
`status: isTerminal ? 200 : 202` over an identical body, so this is the
SAME envelope the 200 documents — only the status code and the reachable
`status` values differ. Keep polling until you get a 200 (issue #3533).
- `id`
- `status`
- `total`
- `completed`
- `failed`
- `created_at`
- `completed_at`
- `total_credits_charged`
- `total_billed_bytes`
- `estimated_credits`
- `webhook_url`

### 401 — Unauthorized. The request carried no valid credential, and no work was
performed. The unified `Error` envelope carries one of the codes below
in `error.code`; match on the code, never on the prose.

- `invalid_api_key` — a bearer API key was presented and rejected:
  unknown, revoked, expired or malformed. The bearer-only operations
  (`/v1/webhook-deliveries*` among them) also return it when no
  `Authorization` header is sent. `GET /v1/account` is the exception
  to "malformed": it returns `invalid_api_key` only for a key that
  starts `sk_test_` or `sk_live_` and is unknown, revoked or expired.
- `unauthorized` — the `Authorization` header is absent or malformed on
  an operation that also accepts a dashboard session (the dual-auth and
  billing operations). `GET /v1/account` also returns it, for no
  `Authorization` header and for any bearer value that does not start
  `sk_test_` or `sk_live_` (that value is checked as a dashboard
  session token).

Not retryable as-is: supply a valid API key first.
- `status`
- `error`
- `error.code`
- `error.message`
- `error.http_status`
- `error.failed_at`
- `error.details`

### 404 — Resource not found.
- `status`
- `error`
- `error.code`
- `error.message`
- `error.http_status`
- `error.failed_at`
- `error.details`