> ## 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 Jobs Batch V1

> Cancel up to 50 jobs in one call. Per-row outcomes — already-terminal jobs (succeeded/failed/cancelled) or unknown ids are reported in their own row without…

Cancel up to 50 jobs in one call.

Per-row outcomes — already-terminal jobs (succeeded/failed/cancelled)
or unknown ids are reported in their own row without blocking the
others. Single Redis sentinel write per cancellable row.

### Request body

`CancelBatchRequest`

<ParamField body="job_ids" type="string (uuid)[]" required>
  List of job UUIDs to cancel (1..50). Already-terminal jobs surface as per-row errors without blocking the rest.
</ParamField>

<ParamField body="reason" type="string,null">
  Optional reason applied to every cancelled row. Stamped on `job.error` like the single-job cancel endpoint.
</ParamField>

### Response

`CancelBatchResponse`

<ResponseField name="cancelled" type="integer" required />

<ResponseField name="skipped" type="integer" required />

<ResponseField name="results" type="CancelBatchItemResult[]" required>
  <Expandable title="CancelBatchItemResult">
    <ResponseField name="job_id" type="string" required />

    <ResponseField name="cancelled" type="boolean" required />

    <ResponseField name="error" type="string,null" />
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `200` | Successful Response |
| `422` | Validation Error    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.computer.stateset.app/api/v1/jobs/cancel-batch' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "job_ids": [
      "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    ],
    "reason": "Two-person tent, green — replacement for damaged pole set."
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "cancelled": 1,
    "skipped": 1,
    "results": [
      {
        "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "cancelled": false,
        "error": "string"
      }
    ]
  }
  ```
</ResponseExample>
