Skip to main content
PATCH
/
sessions
/
{session_id}
Update Session
curl --request PATCH \
  --url https://api.example.com/sessions/{session_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_name": "<string>",
  "session_state": {},
  "metadata": {},
  "summary": {}
}
'
import requests

url = "https://api.example.com/sessions/{session_id}"

payload = {
"session_name": "<string>",
"session_state": {},
"metadata": {},
"summary": {}
}
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({session_name: '<string>', session_state: {}, metadata: {}, summary: {}})
};

fetch('https://api.example.com/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_URL => "https://api.example.com/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([
'session_name' => '<string>',
'session_state' => [

],
'metadata' => [

],
'summary' => [

]
]),
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 := "https://api.example.com/sessions/{session_id}"

payload := strings.NewReader("{\n \"session_name\": \"<string>\",\n \"session_state\": {},\n \"metadata\": {},\n \"summary\": {}\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("https://api.example.com/sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_name\": \"<string>\",\n \"session_state\": {},\n \"metadata\": {},\n \"summary\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/sessions/{session_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"session_name\": \"<string>\",\n \"session_state\": {},\n \"metadata\": {},\n \"summary\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "summary": {
    "summary": "The user discussed project planning with the agent.",
    "updated_at": "2025-10-21T14:30:00Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

session_id
string
required

Session ID to update

Query Parameters

type
enum<string>
default:agent

Session type (agent, team, or workflow)

Available options:
agent,
team,
workflow
user_id
string | null

User ID

db_id
string | null

Database ID to use for update operation

table
string | null

Table to use for update operation

Body

application/json

Session update data

session_name
string | null

Updated session name

session_state
Session State · object | null

Updated session state

metadata
Metadata · object | null

Updated metadata

summary
Summary · object | null

Session summary

Response

Session updated successfully

agent_session_id
string
required

Unique agent session identifier

session_id
string
required

Session identifier

session_name
string
required

Human-readable session name

user_id
string | null

User ID associated with the session

session_summary
Session Summary · object | null

Summary of session interactions

session_state
Session State · object | null

Current state of the session

agent_id
string | null

Agent ID used in this session

total_tokens
integer | null

Total tokens used in this session

agent_data
Agent Data · object | null

Agent-specific data

metrics
Metrics · object | null

Session metrics

metadata
Metadata · object | null

Additional metadata

chat_history
Chat History · object[] | null

Complete chat history

created_at
string<date-time> | null

Session creation timestamp

updated_at
string<date-time> | null

Last update timestamp