Skip to main content
POST
Hard stop a session immediately

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

Path Parameters

sessionId
string<uuid>
required

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 and its events 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 and its events remain readable. The session row itself is removed from reads only by the separate soft-delete endpoint.

cancelled
boolean
required

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.