# Cancel a workflow run

> Cancel a run that is still going: its waiting jobs are cancelled and its running ones stopped.

<div class="g1t-endpoint"><span class="g1t-method" data-method="post">POST</span><code>/repos/{owner}/{name}/actions/runs/{id}/cancel</code></div>

Needs the Write role or higher.

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`workflow`](/reference/mcp/#workflow) with `action` `cancel`, and the same inputs
- **Scope:** An access token needs [`workflows:write`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `owner` | string | Yes | The workspace that owns the repository. |
| `name` | string | Yes | The repository's name. |
| `id` | string | Yes | The run's id. |

## Example request

```sh
curl -X POST https://api.g1t.sh/repos/flagon-io/hello/actions/runs/run_01kpx7b3c6d9e2f5g8h1j4k7mr/cancel \
  -H "Authorization: Bearer $G1T_TOKEN"
```

## Example response

A successful request answers `200` with:

```json
{
  "id": "run_01kpx7b3c6d9e2f5g8h1j4k7mr",
  "workflow_id": "wfl_01kpw2c5d8e1f4g7h0j3k6m9np",
  "path": ".g1t/workflows/ci.yml",
  "name": "CI",
  "title": "Greeting should name the caller",
  "number": 12,
  "attempt": 1,
  "event": "push",
  "ref": "refs/heads/main",
  "sha": "9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0b13",
  "pull": null,
  "status": "completed",
  "conclusion": "cancelled",
  "error": null,
  "actor": "syntaqx",
  "created_at": "2026-10-04T15:42:07.318Z",
  "started_at": "2026-10-04T15:42:09.020Z",
  "finished_at": "2026-10-04T15:44:31.877Z"
}
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 409 | `conflict` | The request conflicts with the current state. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
