Hard stop many sessions at once
Hard-stops many sessions in one call and returns one result per session. Each session is stopped as managedAgentsCancelSessionV2 stops one, with what managedAgentsCancelSessionV2 says stops under it, but on a shorter budget: at most 20 seconds each. A session whose stop has not reached its own row by then reads failed where a single cancel might have finished; cancel that one on its own. Name the sessions in sessionIds (at most 100), or select them the way the session list does with agentId and status, or set all to true to stop every live session the session list shows you. A selection reads the rows managedAgentsListSessionsV2 returns — the sessions the console shows — in a live status (active or awaiting_human), so a delegated session is never selected on its own; it stops when the session that owns it is cancelled, and evaluation runs and session analyst conversations, which the list leaves out, are never selected. A teammate or sub-agent still working or waiting under a session that has already finished stops when that session is cancelled by id. At most 100 sessions are stopped per call: when hasMore is true, call again until it is false. With a selection, send the same body; when a call answers cancelledCount 0 with at least one result failed, stop repeating it: the sessions it reached are failing to stop and come first in the selection, so a repeat would spend its time on them again. A call whose results are all not_attempted may not have reached any session and is repeated, but after three such calls in a row stop and try again later: the platform is not starting stops within a call. Retry the failing ones later, and reach any other matching session by listing it with managedAgentsListSessionsV2 and naming it in sessionIds. With sessionIds, send only the ids answered not_attempted. A call with sessionIds that times out without an answer is repeated with the same body: the call answers within 75 seconds, and a stopped session stays stopped. A selection is not idempotent: it is read again on every call, so a repeat also stops sessions that started matching since the first. Repeat a timed-out selection only when stopping those newer sessions is intended; an automation that must stop exactly what it chose lists the sessions with managedAgentsListSessionsV2 and names them in sessionIds, which it can repeat. Results follow sessionIds’ order, or the selection’s. outcome cancelled means the session is stopped, whether now or earlier, even when stopping something under it failed and is retried by the platform; not_found means it does not exist or you may not change it; failed carries the error its cancel returned, with its code; not_attempted means the call ran out of time before it reached the session or finished stopping it, and a repeat stops it. A failed or not-attempted session leaves the others stopped. Repeating a call with sessionIds is safe: a stopped session stays stopped.
Authorizations
Headers
Body
Which sessions to stop: sessionIds, or a selection by agentId and status, or all.
Sessions to stop, at most 100 distinct session ids as lowercase canonical UUIDs, as the API returns them. Any session you can see is accepted; each stops as managedAgentsCancelSessionV2 describes. Omit to select sessions with agentId, status or all instead.
1 - 100 elements^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Response
Per-session results of a bulk cancel.
Per-session results of a bulk cancel.