Cancel a turn
Cancels a queued, running, or waiting turn and revokes its credential, so the agent can’t start new work. A command that’s already running continues until its own timeout. If the turn has already finished, the request returns it unchanged. The session’s next queued turn then starts.
Authorizations
Headers
A key that identifies this request for retries, up to 200 printable characters. A retry with the same key and input returns the first request's result instead of repeating the work. If you omit the key, the API generates one and returns it in the Idempotency-Key response header.
1 - 200Path Parameters
Response
The canceled turn, or the finished turn unchanged.
The turn's state:
queued: waiting behind the session's active turn.running: the agent is working.waiting: the agent needs input from a person, whichinput_requestdescribes.completed,failed, orcancelled: the turn has ended, and its status doesn't change again.
queued, running, waiting, completed, failed, cancelled Why the turn failed, or null if it didn't fail. The code is one of the following:
agent_error: the agent stopped unexpectedly.app_deleted: the App was deleted.input_expired: no one answered the input request in time.interrupted: the turn was interrupted repeatedly without progress.turn_budget_exceeded: the turn ran out of time.user_deleted: the user the turn acts for deleted their account.