agent

Cancel agent run

Start asynchronous cancellation. A running AgentCore session enters CANCELLING until StopRuntimeSession is confirmed or the bounded stop policy records a terminal failure.

Required scope: `inference:run`

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

Cancellation accepted. Active runs are returned in CANCELLING state.

run_idstring required
thread_idstring required
workflow_typestring required
provider'ANTHROPIC_DIRECT' | 'BEDROCK' | 'OPENAI' | 'VERTEX_AI' required
execution_mode'LOCAL' | 'AGENTCORE' required
status'QUEUED' | 'RUNNING' | 'CANCELLING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED' required

Agent run lifecycle state.

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

Server-enriched agent input used to reconstruct the thread transcript.

parent_run_idstring nullable

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

resultobject nullable
errorobject nullable

Changes