---
title: "Cancel a run"
method: POST
path: "/agent/runs/{runId}/cancel"
tags: ["agent"]
---

# Cancel a run

`POST /agent/runs/{runId}/cancel`

Cancel an agent run that is currently queued or in progress.
Once cancelled, the run will transition to a cancelled state.

Not all runs can be cancelled. Runs that are in a terminal state
(SUCCEEDED, FAILED, ERROR, BLOCKED, CANCELLED) return 400. Runs in
PENDING state return 409 (retry after a moment). Self-hosted, local,
and GitHub Action runs return 422.

## Path parameters

- `runId` string, required

## Response `200`

Run cancelled successfully

- string — The ID of the cancelled run

## Other responses

- `400` — Missing run ID, or the run is already in a terminal state (error_code: invalid_request)
- `401` — Authentication required
- `403` — No permission to cancel run
- `404` — Run not found
- `409` — Run is in PENDING state and cannot be cancelled yet. Retry after a moment (error_code: conflict, retryable: true).
- `422` — Run cannot be cancelled because the operation is not supported for this run type (e.g., self-hosted, local, or GitHub Action runs) (error_code: operation_not_supported)

---

[API](https://skmtc.net/warp/apis/oz-agent-api.md) · [All operations](https://skmtc.net/warp/apis/oz-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/warp/oz-agent-api/versions/97be876c33e3/schema)
