Skip to main content
POST
Hard stop many sessions at once

Authorizations

Authorization
string
header
required

A Recursion API key, created in the console under API keys.

Headers

x-tenant-id
string

Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.

Minimum string length: 1
x-organization-id
string

Organization in which to act. Required for a tenant-scoped API key. Optional for an organization-scoped key, where it must name that same organization. The value may be an organization id or default.

Minimum string length: 1

Body

application/json

Which sessions to stop: sessionIds, or a selection by agentId and status, or all.

agentId
string<uuid>

Select the live sessions of this agent that the session list shows. Omit for every agent.

all
boolean
default:false

Select every live session the session list shows you: evaluation runs and session analyst conversations are not among them. Required when neither sessionIds, agentId nor status is set, so an empty body never stops a fleet by accident; not allowed together with them.

sessionIds
string<uuid>[]

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.

Required array length: 1 - 100 elements
Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
status
enum<string>

Select only sessions in this live status. Omit for both active and awaiting_human.

Available options:
active,
awaiting_human

Response

Per-session results of a bulk cancel.

Per-session results of a bulk cancel.

cancelledCount
integer
required

How many results are cancelled.

Required range: 0 <= x <= 9007199254740991
hasMore
boolean
required

True when sessions remain for another call: the selection matched more live sessions than one call stops, or some sessions were not attempted. The operation's description says how to repeat the call and when to stop.

results
object[]
required

One result per session, in the order of sessionIds or of the selection. Empty when a selection matched no live session.