> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a running job

> **Required scope:** write

**Required scope:** `write`

### Path parameters

<ParamField path="job_id" type="string" required>
  Job identifier
</ParamField>

### Response

`CancelJobResponse`

<ResponseField name="cancelled" type="boolean" required>
  Whether cancellation was successful
</ResponseField>

<ResponseField name="job_id" type="string" required>
  Job identifier
</ResponseField>

<ResponseField name="message" type="string" required>
  Message
</ResponseField>

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Job cancelled                                      |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `404` | Job not found                                      |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/jobs/{job_id}/cancel' \
    --header 'X-API-Key: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "cancelled": false,
    "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "message": "Two-person tent, green — replacement for damaged pole set."
  }
  ```
</ResponseExample>
