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

# Cancel a Training Job

> Cancel a queued or running training job. Returns 202 with the updated job_id and status.

Cancel a job that is still `queued` or `running`. Other statuses return `409 Conflict`. On success the job moves to `cancelled` and any prepaid billing is refunded when possible.

## Method + Path

```http theme={null}
POST /v1/jobs/:id/cancel
```

## Authentication

```http theme={null}
Authorization: Bearer <jwt-or-api-key>
```

## Path parameters

<ParamField path="id" type="string" required>
  The job identifier.
</ParamField>

## Request body

None.

## Response

Returns `202` with:

```json theme={null}
{
  "code": 0,
  "data": {
    "job_id": "jb_abc123def456",
    "status": "cancelled"
  },
  "message": ""
}
```

## Example

```bash theme={null}
curl -s -X POST http://localhost:8001/v1/jobs/jb_abc123def456/cancel \
  -H "Authorization: Bearer $PIN_API_TOKEN"
```

## Errors

| Code | HTTP | Meaning                                                     |
| ---- | ---- | ----------------------------------------------------------- |
| 401  | 401  | Missing or invalid Bearer token.                            |
| 404  | 404  | Job not found or not owned by you.                          |
| 409  | 409  | Job status cannot be cancelled (not `queued` or `running`). |


## Related topics

- [Delete or cancel a training job](/api-reference/pin/jobs/delete.md)
- [Manually intervene in a running training job](/api-reference/pin/jobs/intervene.md)
- [Create Training Job with PIN API](/api-reference/pin/jobs/create.md)
- [Pause, resume, start, or stop a training job](/api-reference/pin/jobs/lifecycle.md)
- [Configure automatic intervention guardrails for training jobs](/api-reference/pin/jobs/auto-intervention.md)
