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. An active Evaluation or one with unfinished clone cleanup returns retryable 409 evaluation_cancellation_pending before the session is stopped; retry after Evaluation cleanup finishes. 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.
Path Parameters
Session id (UUID) as returned by startSession or listSessions.
Response
Response body of POST /v1/sessions/{session_id}/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 /v1/sessions/{session_id}/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.