Skip to main content
Freeze a session: stop anything still running in it and make it read-only, while preserving all of its contents. A closed session can be returned to service with Reopen Session.

POST /revisions/:id/data/command (Command: close_session)

Requires the write role on the blob.

Request Body

Response

The command returns as soon as the session is marked closing. Writes are rejected from that moment on, but the close itself completes in the background — see Asynchronous behavior.

Errors

Example

Asynchronous behavior

Closing happens in two stages:
  1. Immediately — the session becomes closing and every mutating operation on it, including create_execution, starts returning 409 session_not_open.
  2. In the background — every execution still running in the session is stopped and awaited. Once they are all terminal, the session becomes closed and session_closed is emitted.
Do not assume the session is closed when the command returns. Wait for the session_closed event or poll Get Session. With executions to stop this typically takes tens of seconds; with nothing running it is near-immediate.
Executions stopped this way end with status stopped and do not emit execution_ended — that event is reserved for executions that complete on their own.
Reads are unaffected in every stage: a closed session’s objects, threads, graphs and execution history all remain fully readable. See Session Lifecycle for the complete model.