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

# Cancel agent run

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

## Request

- Base URL: `/api/plugins/consensys-asko11y-app/resources` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/plugins/consensys-asko11y-app/resources/api/agent/runs/{runId}/cancel`
- Auth: one of:
  - API key in cookie `grafana_session`
  - HTTP bearer

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.dev/consensys/apis/ask-o11y-ai-powered-observability-assistant-api.md) - [All operations](https://skmtc.dev/consensys/apis/ask-o11y-ai-powered-observability-assistant-api/llms.txt) - [OpenAPI document](https://skmtc.dev/consensys/apis/ask-o11y-ai-powered-observability-assistant-api/revisions/ee3ccd0f186d?raw)
