Skip to content

Update Session

PUT
/api/v3/organizations/{organisation}/ai/sessions/{sessionId}
curl --request PUT \
--url https://dashboard.quantcdn.io/api/v3/organizations/example/ai/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "newMessages": [ { "role": "user", "content": "example" } ], "tokensUsed": 1, "status": "active", "metadata": {} }'

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

organisation
required
string

The organisation ID

sessionId
required
string format: uuid

The session ID

Media typeapplication/json
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

Session updated successfully

Media typeapplication/json
object
sessionId
string format: uuid
status
string
totalMessages
integer
totalTokens
integer
updatedAt
string format: date-time
Examplegenerated
{
"sessionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"status": "example",
"totalMessages": 1,
"totalTokens": 1,
"updatedAt": "2026-04-15T12:00:00Z"
}

Invalid request parameters

Access denied

Session not found

Failed to update session