POST /revisions/:id/data/command (Command: delete_session)
Requires the write role on the blob.
Request Body
Response
The command returns as soon as the session is marked
deleting. The teardown itself runs in the
background — see Asynchronous behavior.
If the session had an alias, the response above does not carry it: delete_session releases the
alias in the same guarded write that starts teardown, so the name is immediately reusable and no
longer resolves to this session.
Errors
The session may be deleted from any live status —
open, closing or closed. It does not have to
be closed first.
Example
Asynchronous behavior
Deletion happens in stages:- Immediately — the session becomes
deleting,session_deletingis emitted, and every mutating operation on it starts returning409session_not_open. - Drain — every execution still running in the session is stopped and awaited until terminal. Nothing is purged while work is still running. This ordering is what stops an in-flight execution from writing into a session that is being torn down.
- Purge — the session’s objects, thread items, graph elements, executions, execution events and stored events are removed, then the session row itself.
- Finally —
session_deletedis emitted.
open session performs this whole sequence as one action; it does not pass through
closed and so emits no session_closed along the way. With executions to drain the teardown
typically takes tens of seconds.
Executions stopped by a delete end with status
stopped and do not emit execution_ended —
that event is reserved for executions that complete on their own.After the delete
Once teardown finishes the session no longer exists:- requests referencing it return
403, includingdownload_session_objectfor objects it contained - it no longer appears in List Sessions
- its per-revision session quota is released
session_deleted
event is delivered over the realtime WebSocket API only — it cannot be read back afterwards with
list_session_events. Clients that need a definitive confirmation should watch for that event, or
poll until the session stops resolving.
See Session Lifecycle for the complete model.
