---
title: "Cancel a pending agent run (idempotent)"
method: POST
path: "/v1/agent/runs/{run_id}/cancel"
tags: ["Agent Runtime"]
---

# Cancel a pending agent run (idempotent)

`POST /v1/agent/runs/{run_id}/cancel`

## Request

- Base URL: `https://api.algenta.ai`
- URL: `https://api.algenta.ai/v1/agent/runs/{run_id}/cancel`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Path parameters

- `run_id` string, uuid, required

## Response `200`

Successful Response

- AgentRunResource
  - `run_id` string, required
  - `status` 'running' | 'paused' | 'requires_approval' | 'completed' | 'cancelled', required
  - `task` string, required
  - `output_format` string, required
  - `approval_mode` 'auto' | 'manual', required
  - `pending_action` 'resume' | 'approve', nullable
  - `selected_tool` string, nullable
  - `result` union
    - string
    - object
  - `tools_available` string[]
  - `tools_used` string[]
  - `steps` AgentStep[]
    - `step` integer, required
    - `action` string, required
    - `tool` string, nullable
    - `result` string, nullable
    - `status` string
  - `request_hash` string, nullable
  - `decision_hash` string, nullable
  - `policy_snapshot_id` string, nullable
  - `schema_snapshot_id` string, nullable
  - `manifest_version` string, nullable
  - `replayable` boolean
  - `artifact_refs` string[]
  - `latest_checkpoint_id` string, nullable
  - `checkpoint_count` integer
  - `source_run_id` string, nullable
  - `source_checkpoint_id` string, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `latency_ms` number, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/codna/apis/algenta-api.md) · [All operations](https://skmtc.dev/codna/apis/algenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/codna/apis/algenta-api/revisions/35d30f84a5df?raw)
