---
title: "Cancel a cloud run – Superbot API"
canonical_url: "https://superbot.gg/developers/runs#cancelRun"
last_updated: "2026-10-01"
summary: "Stop the run. A run that already settled is returned as it is."
---

> Markdown twin of https://superbot.gg/developers/runs#cancelRun (the HTML page is canonical).
> The site index for agents is /llms.txt; every content page has a twin at its path plus `.md`.

# Cancel a cloud run

`POST /v1/runs/{run_id}/cancel`

Stop the run. A run that already settled is returned as it is.

- Operation id: `cancelRun`
- Group: [Runs](https://superbot.gg/developers/runs.md)
- Auth: A caller key holding `runs:write` (`Authorization: Bearer sbc_…` or `x-api-key: sbc_…`), or a signed-in session.
- Scopes: `runs:write`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `run_id` | string | required | The run id (a Run `id`). |

## Response 200

The run after the cancel.

`application/json`: Run.

- `id` (string, required)
- `object` (string, required): One of `run`.
- `status` (string, required): `queued`, `running`, then one of `done`, `failed`, `needs_merge` (the work is on `branch` and waits for a merge) or `cancelled`. One of `queued`, `running`, `done`, `failed`, `needs_merge`, `cancelled`.
- `source` (string, required): What started the run. Runs started here are `api`. One of `app`, `api`, `cli`, `routine`, `slack`, `linear`, `jira`, `github`.
- `project` (string, required): The project the run works on.
- `prompt` (string | null, required): The prompt, which is also the run’s title: show this to name the run. Null under zero data retention.
- `mode` (string, required): One of `agent`, `plan`, `debug`.
- `landing` (string, required): `main` lands the work on the default branch; `pr` opens a pull request. One of `main`, `pr`.
- `budget` (RunBudget, required): What the run may spend: wall time, USD and legs.
  - `max_wall_ms` (integer, required)
  - `max_usd` (number, required)
  - `max_legs` (integer, required)
  - `leg_ms` (integer, required)
- `usd_spent` (number | null, required)
- `branch` (string | null, required): The branch the work sits on, when it did not land directly.
- `landed_commit` (string | null, required)
- `summary` (string | null, required): The runner’s end-of-run diagnostic once it settles, a machine-readable line for debugging and for telling a failed run from a finished one (for example `done — sandbox fence-only, 127 tool call(s), local space sp_…`), and it can name internal ids. It is not a title and not the run’s answer: name the run by `prompt`, and do not show this text to end users. Null under zero data retention.
- `pr_url` (string | null, required)
- `url` (string | null, required): A deep link that opens the run’s project in the Superbot app (`superbot://project/<id>`), when the project id is linkable.
- `created_at` (string, required)
- `updated_at` (string, required)

## Errors

Every refusal carries `error`, `message`, `doc_url` and `request_id`; the gateway routes answer in the dialect you dialed.

| Status | Codes | When |
| --- | --- | --- |
| 400 | [`invalid_request`](https://superbot.gg/developers#errors-invalid_request) | The request is malformed or a parameter is invalid; `param` names the field. |
| 401 | [`unauthorized`](https://superbot.gg/developers#errors-unauthorized) | The bearer is missing, malformed or unknown. |
| 403 | [`insufficient_scope`](https://superbot.gg/developers#errors-insufficient_scope) | The key lacks a scope (insufficient_scope), is revoked, or may not call this route. |
| 404 | [`not_found`](https://superbot.gg/developers#errors-not_found) | No such resource on this account. |
| 429 | [`rate_limited`](https://superbot.gg/developers#errors-rate_limited) | Over the per-key request bucket; retry after x-ratelimit-reset. |

## Examples

```sh
curl -sS -X POST "https://superbot.gg/v1/runs/$RUN_ID/cancel" \
  -H "Authorization: Bearer $SUPERBOT_API_KEY"
```

```js
const runId = 'RUN_ID';
const res = await fetch(`https://superbot.gg/v1/runs/${runId}/cancel`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SUPERBOT_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

```python
import os
import requests

run_id = "RUN_ID"
res = requests.request(
    "POST",
    f"https://superbot.gg/v1/runs/{run_id}/cancel",
    headers={
        "Authorization": f"Bearer {os.environ['SUPERBOT_API_KEY']}",
    },
)
print(res.status_code, res.json())
```
