Sessions
Create, list, update, and delete chat sessions.
A session represents a single conversation thread between a user and an AI agent. Sessions preserve conversation history so the AI can provide contextual responses.
Create a Session
Creates a new chat session for the specified agent.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string (UUID) | Yes | The agent ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Session name. Defaults to a timestamp. |
externalUserId | string (UUID) | No | Your user's ID for tracking. Auto-generated if omitted. |
Response
Code Examples
List Sessions
Returns all chat sessions for the specified agent.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
externalUserId | string (UUID) | Filter sessions by external user ID |
Response
Code Examples
Get Session Details
Returns session metadata and the full message history.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string (UUID) | Yes | The agent ID |
sessionId | string (UUID) | Yes | The session ID |
Response
Update Session
Update session details such as the session name.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | New session name |
Response
Delete Session
Permanently deletes a chat session and all its messages.
This action is irreversible. All messages in the session will be permanently deleted.