## Cancel Batch Job

`BatchCancelResponse Beta.Batch.Cancel(BatchCancelParamsparameters, CancellationTokencancellationToken = default)`

**post** `/api/v1/beta/batch-processing/{job_id}/cancel`

Cancel a running batch processing job.

Stops processing and marks pending items as cancelled.
Items currently being processed may still complete.

### Parameters

- `BatchCancelParams parameters`

  - `required string jobID`

    Path param

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `string? reason`

    Body param: Optional reason for cancelling the job

  - `string temporalNamespace`

    Header param

### Returns

- `class BatchCancelResponse:`

  Response after cancelling a batch job.

  - `required string JobID`

    ID of the cancelled job

  - `required string Message`

    Confirmation message

  - `required Long ProcessedItems`

    Number of items processed before cancellation

  - `required Status Status`

    New status (should be 'cancelled')

    - `"cancelled"Cancelled`

    - `"completed"Completed`

    - `"dispatched"Dispatched`

    - `"failed"Failed`

    - `"pending"Pending`

    - `"running"Running`

### Example

```csharp
BatchCancelParams parameters = new() { JobID = "job_id" };

var response = await client.Beta.Batch.Cancel(parameters);

Console.WriteLine(response);
```

#### Response

```json
{
  "job_id": "job_id",
  "message": "message",
  "processed_items": 0,
  "status": "cancelled"
}
```
