Skip to content

Update Session

PUT
/api/v3/organizations/{organisation}/ai/sessions/{sessionId}

Updates session with new conversation messages and tracks token usage. Appends new messages to conversation history and updates session stats. * * Typical Flow: * 1. Get session to retrieve conversation history * 2. Call AI inference with full message history * 3. Update session with new user + assistant messages

Authorizations

Parameters

Path Parameters

organisation
required
string

The organisation ID

sessionId
required
string format: uuid

The session ID

Request Body required

object
newMessages

New messages to append to conversation

Array<object>
object
role
string
Allowed values: user assistant
content
string
tokensUsed

Tokens consumed in this turn

integer
status

Update session status

string
Allowed values: active completed
metadata

Update custom metadata

object

Responses

200

Session updated successfully

object
sessionId
string format: uuid
status
string
totalMessages
integer
totalTokens
integer
updatedAt
string format: date-time

400

Invalid request parameters

403

Access denied

404

Session not found

500

Failed to update session