---
title: "Cancel run"
method: POST
path: "/runs/{id}/cancel"
tags: ["Runs"]
---

# Cancel run

`POST /runs/{id}/cancel`

## Request

- Base URL: `https://api.edgaze.ai/v1`
- URL: `https://api.edgaze.ai/v1/runs/{id}/cancel`
- Auth: HTTP bearer

Request cancellation of a run that is still in flight. Idempotent: a run that already reached a terminal state is returned unchanged with `cancelRequested: false`. A run that has not started executing yet is cancelled before this call returns. A run that is executing is stopped asynchronously: the response carries its current status with `cancelRequested: true`, and the run reaches `cancelled` shortly after, with a `run.cancelled` webhook. A cancelled run is never charged to the buyer (`billingStatus` settles to `not_charged`). Requires `run:execute`, not `run:read`, because it changes the run's outcome.

## Path parameters

- `id` string, required: UUID returned from POST /runs.

## Response `200`

Cancellation recorded.

- CancelRunResponse: Response body for POST /runs/{id}/cancel.
  - `id` string, uuid, required
  - `status` 'pending' | 'running' | 'suspended' | 'completed' | 'failed' | 'cancelled', required: Canonical run status exposed by the public API.
  - `cancelRequested` boolean, required: True when this call initiated the cancellation, false when the run was already in a terminal state and nothing changed.

## Other responses

- `401`: Invalid or missing API key.
- `403`: API key is missing the required scope.
- `404`: Run not found (also returned for cross-tenant calls).
- `500`: Unexpected server error.
- `503`: Cancellation could not be delivered. Safe to retry.

---

[API](https://skmtc.dev/edgaze/apis/edgaze-api.md) · [All operations](https://skmtc.dev/edgaze/apis/edgaze-api/llms.txt) · [OpenAPI document](https://skmtc.dev/edgaze/apis/edgaze-api/revisions/cfc6436d2f90?raw)
