user.message through the events endpoint. To create a session, see Create a Session.
Check session status
status indicates the current state of a session. Public values are idle, running, stopping, and terminated.
Newly created sessions start in the
idle state. When you send input, the session enters running and returns to idle once the turn finishes. Canceling the current turn moves the session to stopping while execution is finalized, then returns it to idle. Archiving transitions the session to terminated.
Use the command below to check the current status of a session. Replace $SESSION_ID with the id from the session creation response. For a full session creation example, see Create a Session.
session.status events in the event stream. When a session returns to idle, the event may include data.stop_reason indicating why the turn stopped; see Event Stream.
List sessions
CallGET /v1/sessions to list sessions visible to the caller. items in the response contains the sessions on the current page; when more results exist, the response also includes next_page_token to fetch the next page.
Retrieve a session
CallGET /v1/sessions/{id} to retrieve session details.
agent is the snapshot of the agent version pinned at creation time, and resources lists the resource references bound to the session (including files added after creation).
Update the session title
CallPATCH /v1/sessions/{id} to update the session title. Fields omitted from the request body remain unchanged.
Override agent configuration in a session
You can updateagent_overrides on a session to override the MCP server, skill, and tool configurations from the pinned agent version for subsequent turns in that session.
This operation does not modify the agent itself or create a new agent version.
agent_overrides supports mcp_servers, skills, plugins, tools, model, and system. mcp_servers accepts at most 20 servers, skills accepts at most 64 skills, plugins accepts at most 64 plugins, and tools accepts at most 128 declarations. roster can also be set when creating a session, and its entries are resolved and pinned to exact versions at creation time; passing roster when updating a session returns HTTP 400 invalid_parameter_error. The provider of model must match the session’s model provider.
Each collection field is replaced in full rather than merged with the existing collection:
- Omitting a field retains the existing override configuration for that collection.
- Passing an empty array clears the override for that collection and falls back to the corresponding collection on the pinned agent version.
- Passing a non-empty array replaces the entire override for that collection.
mcp_servers override. It leaves skills and tools unchanged because neither field appears in the request body.
agent_overrides does not require the session to be idle. Any turn currently in progress continues with the previous configuration, and subsequent turns use the updated configuration.
Cancel the current turn
Send auser.interrupt event to POST /v1/sessions/{id}/events to stop the session and its active threads; user.interrupt must be the only event in the request. Both running and idle sessions accept stop requests; calling this endpoint on a terminated session returns HTTP 400 failed_precondition_error. When accepted, the endpoint responds with 202; user.interrupt is not queued, and the response does not include an event_id.
Once canceled, the session returns to idle and can still receive new input.
Archive a session
CallPOST /v1/sessions/{id}/archive to set the session status to terminated. A running session cannot be archived (HTTP 400 failed_precondition_error). Cancel the current turn or wait for it to finish, and wait until the session returns to idle before archiving; a session that is still stopping returns HTTP 409 conflict_error. Archiving is irreversible. You can still read events and download files after archiving. If you plan to delete the session later, download anything you need to keep before deleting it, because deletion permanently removes them. An archived session is read-only and cannot accept further input.
The archive endpoint responds with 204.
Delete a session
Onlyterminated sessions can be deleted. Archive the session first, and then call DELETE /v1/sessions/{id} to delete it permanently. If the session is still bound to a trigger in reuse_session mode, archive that trigger first (otherwise deletion returns HTTP 400 failed_precondition_error). If lifecycle work or active threads remain right after archiving, deletion returns HTTP 409 conflict_error; retry once they finish. Deletion is irreversible—once deleted, the session, its events, and its resources can no longer be queried.
204.