---
title: "Cancel a job"
description: "Stop a queued or running job. `POST /api/v1/jobs/{id}/cancel`"
url: https://www.unitpost.com/docs/platform/post-jobs-id-cancel
section: "Platform API reference"
updated: 2026-10-13
---
# Cancel a job

`POST /api/v1/jobs/{id}/cancel`

Stop a queued or running job. A running job stops after the part in flight; the work already done stays. A kind that can't stop half-way (a custom-field rename) is a `409` saying why. Takes no body. Needs the capability that starts the kind (`contacts:write` for a custom-field job, `contacts:read` for an export, `topics:write` for a topic opt-out). Requires the `contacts:read` or `contacts:write` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `id` | string | yes | — |
| `kind` | string | yes | — |
| `status` | enum | yes | One of: `QUEUED`, `RUNNING`, `COMPLETED`, `FAILED`, `CANCELED`. |
| `total` | integer \| null | yes | — |
| `processed` | integer | yes | — |
| `failed` | integer | yes | — |
| `error` | string \| null | yes | — |
| `created_at` | string | yes | — |
| `completed_at` | string \| null | yes | — |

## Responses

| Status | Description |
| --- | --- |
| 200 | The job, canceled. |
| 400 | The body isn't JSON. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope for this job's kind. |
| 404 | Job not found. |
| 409 | It has finished, or its kind can't be stopped. |
| 422 | A body key (this operation takes none). |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/jobs/job_123/cancel' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
```

## Example response (200)

```json
{
  "object": "job",
  "id": "id_123",
  "kind": "string",
  "status": "QUEUED",
  "total": 1,
  "processed": 0,
  "failed": 0,
  "error": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "completed_at": "2026-01-01T00:00:00.000Z"
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/platform/post-jobs-id-cancel
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
