Cancel an agent run

View as Markdown
Stops a run permanently. Work it already completed is retained.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequired>=1 character

Headers

idempotency-keystringOptional1-255 characters
Retries with the same key replay the first applied mutation.

Query parameters

waitintegerOptional0-120Defaults to 60

How many seconds to hold the request open. Releases early the moment the run finishes or blocks on a person. Maximum 120; 0 returns immediately.

Request

An optional reason for cancelling.
reasonstringOptional1-4000 characters

Response headers

idempotent-replaystringOptional

true when this response replays an earlier request.

Response

The cancelled run state.
object"agent_run_control"
actionenum
runobject

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error