Skip to main content
POST
Cancel agent run
meta.cancellation_status shows the result: HTTP 202 alone does not confirm the stop. Cancellation does not undo completed work. The reason goes to the organization audit log. Requires write:agents and an API key with an owner.

Authorizations

X-API-Key
string
header
required

Your organization API key. See Authentication.

Headers

Idempotency-Key
string
required

Unique key for this operation. Retry with the same key and request body after a timeout. Keys are retained for at least 24 hours.

Required string length: 1 - 255

Path Parameters

agent_id
string
required

ID of the agent.

Minimum string length: 1
run_id
string
required

ID of the run.

Minimum string length: 1

Body

application/json
reason
string
required

Reason included in the organization audit event.

Required string length: 1 - 500
Example:

"Correct the selected accounting records."

Response

Current run and cancellation outcome. Poll status_url for the final state.

data
object
required
meta
object
required

Cancellation details.