---
title: "Cancel live runs"
description: "Stop the automation's live runs in one call: all of them (status: live, the default) or only active or waiting ones. `POST /api/v1/automations/{id}/runs/cancel`"
url: https://www.unitpost.com/docs/automations/post-automations-id-runs-cancel
section: "Automations API reference"
updated: 2026-12-01
---
# Cancel live runs

`POST /api/v1/automations/{id}/runs/cancel`

Stop the automation's live runs in one call: all of them (`status: live`, the default) or only `active` or `waiting` ones. Their timers are cancelled and nothing more executes for them. Cancel them before deleting an automation that still has runs in progress. With `contact_id`, only that contact's runs stop (naming a contact also needs `contacts:read`); to stop a contact in every automation, use [Cancel a contact's automation runs](https://www.unitpost.com/docs/automations/post-contacts-id-automation-runs-cancel). Requires the `automations:write` capability.

## Parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | enum | no | Which live runs to cancel: all (`live`, default), only `active` or only `waiting`. One of: `live`, `active`, `waiting`. |
| `backfill` | string | no | Only one backfill's runs (`job_…`, or `latest`): it stops that backfill (nobody else starts) and cancels the live runs it started; runs the trigger started are left alone. |
| `contact_id` | string | no | Only this contact's runs (`con_…`; also needs `contacts:read`): stop one person in this automation and leave everyone else's runs alone. To stop them in every automation, use POST /contacts/{id}/automation-runs/cancel. |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `canceled` | integer | yes | — |
| `backfill` | object | no | — |

## Responses

| Status | Description |
| --- | --- |
| 200 | How many runs were canceled. |
| 400 | A body that isn't JSON. Nothing was canceled. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope. |
| 404 | Automation (or `contact_id`) not found. |
| 422 | A bad `status`, an unknown key, or a body that isn't a JSON object. Send no body to cancel every live run. |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/automations/atm_123/runs/cancel' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "contact_id": "con_123"
  }'
```

## Example response (200)

```json
{
  "object": "automation_runs_cancel",
  "canceled": 0,
  "backfill": {
    "job_id": "job_123",
    "stopped": false
  }
}
```

## Links

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