v52

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-0393116227.2 KB
agent

Cancel agent run

Mark an asynchronous agent run as cancelled.

Required roles: All, App

post/agent/runs/{run_id}/cancel

Path parameters

run_idstring required

Query parameters

principal_idstring

Scope by principal. If omitted, only a run with no principal (principal_id is null) is addressed; a run whose principal differs yields 404.

Response

Cancelled agent run

run_idstring required
thread_idstring
workflow_typestring required
provider'ANTHROPIC_DIRECT' | 'BEDROCK' | 'VERTEX_AI' required
execution_mode'LOCAL' | 'AGENTCORE' required
statusstring required

Agent run status. Values are QUEUED, RUNNING, SUCCEEDED, FAILED, or CANCELLED.

runtime_arnstring
runtime_session_idstring
mcp_session_idstring
trace_idstring
idempotency_keystring
created_atstring date-time
started_atstring date-time
finished_atstring date-time
inputobject

Original RunAgentInput. Used to reconstruct a thread's transcript on restore.

parent_run_idstring nullable

Run this run branched from within the thread (null for the thread root).

resultobject
errorobject