Updates session state without running the agent.

Args: app_name: The name of the application. user_id: The ID of the user. session_id: The ID of the session to update. req: The patch request containing state changes.

Returns: The updated session.

Raises: HTTPException: If the session is not found.

patch/apps/{app_name}/users/{user_id}/sessions/{session_id}

Request

  • The document declares no server URL.
  • Auth
    none declared

Path parameters

app_name, string required
user_id, string required
session_id, string required

Request body

UpdateSessionRequest required

Request to update session state without running the agent.

stateDelta, object required

Response

Successful Response

Session required

Represents a series of interactions between a user and agents.

id, string required

Unique identifier of the session.

appName, string required

Application name that owns the session.

userId, string required

User ID that owns the session.

state, object

Current persisted session state.

events, EventOutput[]

Ordered event history for the session, including user, model, and tool events (e.g. user input, model response, function call/response).

lastUpdateTime, number

Unix timestamp in seconds for the most recent session update.

Example response

{
  "id": "session-abc123",
  "appName": "hello_world",
  "userId": "user-123",
  "state": {
    "locale": "en-US"
  },
  "lastUpdateTime": 1742000000
}

Changes

    • warning

      added the new ESCALATION enum value to the events/items/finishReason/anyOf[subschema #1: FinishReason] response property for the response status

    • warning

      added the new MALFORMED_RESPONSE enum value to the events/items/finishReason/anyOf[subschema #1: FinishReason] response property for the response status

    • warning

      added the new MISSING_THOUGHT_SIGNATURE enum value to the events/items/finishReason/anyOf[subschema #1: FinishReason] response property for the response status

    22 more changes in this revision