Skip to content

Cancel Agent Run

POST
/agent/runs/{run_id}/cancel

Stop a run and everything it spawned.

OWNER ONLY, and that is stricter than the read routes on purpose: shared visibility lets an org SEE a teammate’s run, while stopping it is destructive and not undone by restarting. Children are signalled before the root so a freed parent cannot leave orphans behind it.

Idempotent on an already-terminal run: cancelled: false with a reason, not an error, so a double call does not look like a failure.

Authorizations

Parameters

Path Parameters

run_id
required

Run ID

string format: uuid

Run ID

Header Parameters

X-Target-Org-Id
Any of:
string

Responses

200

Successful Response

object
data
required
object
cancelled
required
boolean
children_cancelled

Sub-agents signalled alongside the run.

Array<string>
detail
string
""
work_item_id
required
string
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string