Session and Event
A Session is a running instance of an agent, bound to an agent snapshot and an environment, with its state machine driven by the platform. An Event is an atomic record inside a session, written by the client or pushed by the server through a subscription.
State machine
The session state field is status. State changes are pushed via the SSE session_status event — see Subscribe to Event SSE Stream.
State | Trigger | Next state | Allowed operations |
|---|---|---|---|
| Session created, or the previous turn finished. | On message → | Send message, archive, delete. |
| User message received; the agent has started processing. | On completion → | Interrupt, approve a tool call, submit a function result. |
| Archive call, or an unrecoverable error. | Terminal state. | Query event history, delete the session. |
Session operations
Operation | Endpoint | Description |
|---|---|---|
| Create a session, bound to an agent snapshot and a runtime environment; initial state is | |
| Get session details, including the agent snapshot and current state. | |
| Paginated list of sessions under the workspace. | |
| Update session metadata (title, metadata, and so on). | |
| Soft archive; the session moves to the | |
| Hard delete; event history is removed and cannot be recovered. |
Session resource operations
Operation | Endpoint | Description |
|---|---|---|
| Dynamically mount a file while the session is running; the server stores an internal copy. This operation does not produce a session event. | |
| Paginated list of resources currently mounted in the session. | |
| Get details of a single mounted resource in the session. | |
| Unmount the specified resource from the session and remove its internal copy. This operation cannot be undone. |
Event operations
Operation | Endpoint | Description |
|---|---|---|
| Inject an event into the session (user message, interrupt, tool approval, function result, and so on). | |
| Paginated list of event history in the session. | |
| Long-lived SSE connection that streams real-time events, including |