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

# Cancel agent run

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

Cancels a running agent. Only the user who created the run (in the same organization) can cancel it. Returns 409 if the run is not currently running.

## Path parameters

- `runId` string, required

## Headers

- `X-Grafana-Org-Id` string

## Response `200`

Run cancelled successfully

- object
  - `status` 'cancelled'

## Other responses

- `401` — Unauthorized (missing or invalid authentication)
- `403` — Forbidden (insufficient permissions or RBAC violation)
- `404` — Resource not found
- `409` — Run is not running (already completed, failed, or cancelled)
- `500` — Internal server error

---

[API](https://skmtc.net/consensys/apis/ask-o11y-ai-powered-observability-assistant-api.md) · [All operations](https://skmtc.net/consensys/apis/ask-o11y-ai-powered-observability-assistant-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/consensys/ask-o11y-ai-powered-observability-assistant-api/versions/3ccc03eccaef/schema)
