# Jobs

> Robots API reference, generated from the OpenAPI spec.

HTML version: https://www.mux.com/docs/api-reference/robots/jobs. Full OpenAPI spec: https://www.mux.com/api-spec.json

## Cancel a job

`POST https://api.mux.com/robots/v1/jobs/{JOB_ID}/cancel`

Cancels a job that is currently pending or processing.

Operation ID: `cancel-job`. HTML version: https://www.mux.com/docs/api-reference/robots/jobs/cancel-job

### Path parameters

- `JOB_ID` (string, required, minLength: 1, maxLength: 255): Robots job ID returned by job creation or listing (rjob_...).

### Response `200`

Job cancelled successfully

- `data` (object, required)
  - `id` (string, required): Unique job identifier.
  - `workflow` (string, required): Workflow type that created this job. Possible values: `"analyze-structure"`, `"summarize"`, `"generate-contextual-text"`, `"moderate"`, `"generate-chapters"`, `"edit-captions"`, `"translate-captions"`, `"translate-audio"`, `"ask-questions"`, `"find-key-moments"`, `"generate-engagement-insights"`, `"generate-premium-captions"`, `"find-best-thumbnails"`.
  - `status` (string, required): Current job status. Possible values: `"pending"`, `"processing"`, `"completed"`, `"errored"`, `"cancelled"`.
  - `created_at` (integer, required, minimum: 0): Unix timestamp (seconds) when the job was created.
  - `updated_at` (integer, required, minimum: 0): Unix timestamp (seconds) of the job's last state transition (e.g. when it started processing or reached a terminal state).
  - `_links` (object, required): Hypermedia links for this job.
    - `self` (object, required)
      - `href` (string, required): URL to this resource.

### Errors

- `401`: Missing or invalid Mux credentials
- `403`: The access token lacks robots:write (insufficient_scope), or Robots access is inactive or suspended. For insufficient_scope, use credentials with the required permission. If using an API access token, create a replacement token with that permission. Enabling Robots for an organization does not grant token permissions.
- `404`: Job not found
- `409`: Job is already in a terminal state
- `422`: Invalid request parameters
- `500`: Server error

Every error response has this body:

- `error` (object, required)
  - `type` (string, required): Machine-readable error type. New types may be added, so handle unknown values.
  - `code` (string): Identifies the specific condition that failed, when it has a public code. Absent for other errors. New codes may be added, so handle unknown values.
  - `messages` (array of string, required): Individual error messages describing what went wrong.
