---
title: "Cancel Job"
method: POST
path: "/v1/jobs/{job_id}/cancel"
tags: ["jobs"]
---

# Cancel Job

`POST /v1/jobs/{job_id}/cancel`

Cancel an in-flight job.

Routes a ``CancelRequest`` through the scheduler (the single writer of ``jobs`` /
``computation_node``) and awaits the outcome — never writes the DB directly. The
scheduler flips the job + its non-terminal nodes to ``cancelled``, releases the
concurrency lease, and interrupts in-flight worker executions.

Idempotent: cancelling an already-cancelled job is a ``200`` no-op; a
``completed`` / ``failed`` job is a ``409`` (you can't cancel a finished job); an
unknown job — or one belonging to another org — is a ``404``.

## Path parameters

- `job_id` string, uuid, required

## Response `200`

Successful Response

- JobResponse — A job resource — the uniform, control-plane envelope over every job implementation. Stable across every status; status-specific fields (``error``) are present-but-null rather than added/removed. Heavy, high-frequency, or implementation-specific data lives behind the ``*_url`` sub-resources, never inline.
  - `id` union, required
    - string, uuid
    - string
  - `job_type` string, required
  - `status` 'pending' | 'running' | 'completed' | 'failed' | 'cancelled', required
  - `progress` number, nullable
  - `error` JobError — Structured failure info; present on a ``JobResponse`` only when ``status == failed``.
    - `code` string, required
    - `message` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `metrics_url` string, required
  - `result_url` string, required
  - `artifacts_url` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/outerproduct/apis/outerproduct-api.md) · [All operations](https://skmtc.net/outerproduct/apis/outerproduct-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/outerproduct/outerproduct-api/revisions/6c6e81fb3282/schema)
