Hard stop a session immediately
Stops the session immediately and schedules durable sandbox teardown. The response confirms the session stopped; sandbox cleanup may continue asynchronously and is retried. A session that already reached a terminal status with no pending cleanup is left as it is, so the call is safe to repeat.
Authorizations
A Recursion API key, created in the console under API keys.
Headers
Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.
1Organization 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.
1Path Parameters
Session id (UUID) as returned by managedAgentsStartSession or managedAgentsListSessions.
Response
Response body of POST /managed-agents/v1/sessions/{sessionId}/cancel. Cancel is terminal for the run but not for the record: the session is stopped and the sandbox torn down, while the session, its events, and its outcomes remain readable. The session row itself is removed from reads only by the separate soft-delete endpoint.
Response body of POST /managed-agents/v1/sessions/{sessionId}/cancel. Cancel is terminal for the run but not for the record: the session is stopped and the sandbox torn down, while the session, its events, and its outcomes remain readable. The session row itself is removed from reads only by the separate soft-delete endpoint.
Always true. The session was stopped and the sandbox closed; failures are HTTP errors instead, so this field never reports false. It is also true when the session had already reached a terminal state, making cancel safe to retry.