---
title: "Cancel agent run"
method: POST
path: "/agent_run/{run_id}/cancel"
tags: ["Agents"]
---

# Cancel agent run

`POST /agent_run/{run_id}/cancel`

## Request

- Base URL: `https://api.mosaic.so`
- URL: `https://api.mosaic.so/agent_run/{run_id}/cancel`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Cancel an ongoing agent run

## Path parameters

- `run_id` string, required

## Response `200`

Agent run cancelled successfully

- object
  - `success` boolean
  - `run_id` string
  - `tasks_cancelled` number
  - `nodes_reset` number
  - `message` string

## Other responses

- `401`: Authentication failed
- `404`: Resource not found

---

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