---
title: "Cancel Agent Session"
method: POST
path: "/api/platform/v1/agents/{session_id}/cancel"
tags: ["workflows"]
---

# Cancel Agent Session

`POST /api/platform/v1/agents/{session_id}/cancel`

## Request

- Base URL: `https://docs.amdahl.ai`
- URL: `https://docs.amdahl.ai/api/platform/v1/agents/{session_id}/cancel`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Cancel an in-flight agent run. Use when the user wants to stop a running agent before it finishes, or abandon a run that has gone sideways. Cascades to any sub-agents spawned from this run via agents.delegate — every live descendant is cancelled atomically. The runner bails at the next iteration boundary after observing the status change. Already-completed runs cannot be canceled. Pass a reason to record WHY the run was aborted in the audit trail.

## Path parameters

- `session_id` string, uuid, required

## Request body

- object
  - `reason` string: Optional operator note describing why the run was canceled.

## Response `200`

OK

- object
  - `data` unknown

## Other responses

- `400`: Invalid input - failed schema validation
- `401`: Authentication required
- `403`: Forbidden - missing scope or role
- `500`: Internal server error

---

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