Update Session
PUT
/api/v3/organizations/{organisation}/ai/sessions/{sessionId}
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/ai/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"newMessages":[{"role":"user","content":"example"}],"tokensUsed":1,"status":"active","metadata":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”organisation
required
string
The organisation ID
sessionId
required
string format: uuid
The session ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
newMessages
New messages to append to conversation
Array<object>
object
role
string
content
string
tokensUsed
Tokens consumed in this turn
integer
status
Update session status
string
metadata
Update custom metadata
object
Responses
Section titled “Responses”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
