Update a chat session
curl --request PATCH \
--url http://localhost:8080/chat/sessions/{session_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"generate_summary_and_sentiment_on_resolve": true,
"reflect_status_change_for_integration": true,
"session_closed_payload": {},
"summary": "<string>"
}
'import requests
url = "http://localhost:8080/chat/sessions/{session_id}"
payload = {
"generate_summary_and_sentiment_on_resolve": True,
"reflect_status_change_for_integration": True,
"session_closed_payload": {},
"summary": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
generate_summary_and_sentiment_on_resolve: true,
reflect_status_change_for_integration: true,
session_closed_payload: {},
summary: '<string>'
})
};
fetch('http://localhost:8080/chat/sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/chat/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'generate_summary_and_sentiment_on_resolve' => true,
'reflect_status_change_for_integration' => true,
'session_closed_payload' => [
],
'summary' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/chat/sessions/{session_id}"
payload := strings.NewReader("{\n \"generate_summary_and_sentiment_on_resolve\": true,\n \"reflect_status_change_for_integration\": true,\n \"session_closed_payload\": {},\n \"summary\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost:8080/chat/sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"generate_summary_and_sentiment_on_resolve\": true,\n \"reflect_status_change_for_integration\": true,\n \"session_closed_payload\": {},\n \"summary\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/chat/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"generate_summary_and_sentiment_on_resolve\": true,\n \"reflect_status_change_for_integration\": true,\n \"session_closed_payload\": {},\n \"summary\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Sessions
Update a chat session
Update a chat session — Updates a chat session. Use when orchestrating conversations from code — creating sessions, sending messages, or listing history for an external surface.
PATCH
/
chat
/
sessions
/
{session_id}
Update a chat session
curl --request PATCH \
--url http://localhost:8080/chat/sessions/{session_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"generate_summary_and_sentiment_on_resolve": true,
"reflect_status_change_for_integration": true,
"session_closed_payload": {},
"summary": "<string>"
}
'import requests
url = "http://localhost:8080/chat/sessions/{session_id}"
payload = {
"generate_summary_and_sentiment_on_resolve": True,
"reflect_status_change_for_integration": True,
"session_closed_payload": {},
"summary": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
generate_summary_and_sentiment_on_resolve: true,
reflect_status_change_for_integration: true,
session_closed_payload: {},
summary: '<string>'
})
};
fetch('http://localhost:8080/chat/sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/chat/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'generate_summary_and_sentiment_on_resolve' => true,
'reflect_status_change_for_integration' => true,
'session_closed_payload' => [
],
'summary' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/chat/sessions/{session_id}"
payload := strings.NewReader("{\n \"generate_summary_and_sentiment_on_resolve\": true,\n \"reflect_status_change_for_integration\": true,\n \"session_closed_payload\": {},\n \"summary\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("http://localhost:8080/chat/sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"generate_summary_and_sentiment_on_resolve\": true,\n \"reflect_status_change_for_integration\": true,\n \"session_closed_payload\": {},\n \"summary\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/chat/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"generate_summary_and_sentiment_on_resolve\": true,\n \"reflect_status_change_for_integration\": true,\n \"session_closed_payload\": {},\n \"summary\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Send
summary to replace the session’s summary, for example with notes from a system that handled part of the conversation. Send null to clear it. A summary-only update leaves the status unchanged. When the same request closes the session with generate_summary_and_sentiment_on_resolve, the summary you send is kept instead of the generated one.
AI outcome on close
Closing a session asclosed_resolved while the AI agent owns it outside assist mode records the AI outcome assumed_resolved, provided the AI agent replied and no teammate replied or took the session over. The outcome counts toward the AI resolutions in your impact report and is passed to ticket-resolved workflows. Voice and internal sessions are left unchanged. A closed_unresolved close never records an AI outcome, reclosing or retrying a close keeps the outcome already on the session, and a session closed as unresolved is not marked as an AI resolution when it is later changed to resolved. Each close is written to the audit log with the API key that made it.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the chat session
Body
application/json
Available options:
open, closed_resolved, closed_unresolved Show child attributes
Show child attributes
Replace the session summary, or null to clear it. Takes precedence over a summary generated on resolve.
Required string length:
1 - 10000Response
Default Response
Was this page helpful?