API reference
Abort
POST /v1/agents/abort
View as MarkdownStops a running task. Safe to call when nothing is running.
Request
Recommended for API callers: name the session you started.
json
{ "sessionId": "cs_01HZY" }Or name the computer and the channel:
json
{ "machineId": "m_7f2a", "channel": "api" }Response
A task was stopped:
json
{ "ok": true, "aborted": true }Nothing to stop:
json
{ "ok": true, "aborted": false, "reason": "session already idle or aborting" }reason is no active session or session already idle or aborting.
Errors
Gotchas
- Use
sessionId. It needs no machine lookup, so it also works on a free account's computer between claims. - With
machineId, the default channel iscli. Forgettingchannel: "api"reportsno active sessionwhile your task keeps running. - Pending approvals on the aborted task are resolved as denied, so nothing is left waiting.
Note
sessionIdandchannelon/abortare available from October 1. Today's staging acceptsmachineIdonly and stops the CLI's conversation.