Skip to main content
POST
Create Session

Path Parameters

app_name
string
required
user_id
string
required

Body

application/json
sessionId
string | null

The ID of the session to create. If not provided, a random session ID will be generated.

state
State · object | null

The initial state of the session.

events
Event · object[] | null

A list of events to initialize the session with.

Response

Successful Response

Represents a series of interactions between a user and agents.

id
string
required

Unique identifier of the session.

Example:

"session-abc123"

appName
string
required

Application name that owns the session.

Example:

"hello_world"

userId
string
required

User ID that owns the session.

Example:

"user-123"

state
State · object

Current persisted session state.

Example:
events
Event · object[]

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

lastUpdateTime
number
default:0

Unix timestamp in seconds for the most recent session update.

Example:

1742000000