---
title: "Cancel run"
method: POST
path: "/v1/projects/{project_id}/runs/{run_id}/cancel"
tags: ["runs"]
---

# Cancel run

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

## Request

- Base URL: `https://api.connic.co`
- URL: `https://api.connic.co/v1/projects/{project_id}/runs/{run_id}/cancel`
- Auth: HTTP bearer

Cancels a run that is scheduled, queued or running.

Only runs with status `scheduled`, `queued` or `started` can be cancelled; other statuses return 400.
A running run is marked `cancelled` immediately and its agent stops shortly after.

Required permission: `runs.cancel`.

## Path parameters

- `project_id` string, uuid, required
- `run_id` string, uuid, required

## Response `200`

Successful Response

- PublicRunCancelResponse
  - `ok` boolean, required: Whether the operation succeeded.
  - `message` 'Run cancelled' | 'Cancel signal sent', required: `Run cancelled` when a scheduled or queued run was cancelled before it started. `Cancel signal sent` when the run was already executing and is being stopped.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required permission or access to the environment.
- `404`: The resource does not exist in this project.
- `422`: Validation Error
- `429`: Rate limit exceeded.

---

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