curl --request PATCH \
--url https://api.sigmamind.ai/v1/chats/{chatId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agentId": "D5D0p7TUs66TTAEAx",
"dynamicVariables": {
"customer_name": "Michael"
}
}
'import requests
url = "https://api.sigmamind.ai/v1/chats/{chatId}"
payload = {
"agentId": "D5D0p7TUs66TTAEAx",
"dynamicVariables": { "customer_name": "Michael" }
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agentId: 'D5D0p7TUs66TTAEAx', dynamicVariables: {customer_name: 'Michael'}})
};
fetch('https://api.sigmamind.ai/v1/chats/{chatId}', 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.sigmamind.ai/v1/chats/{chatId}",
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([
'agentId' => 'D5D0p7TUs66TTAEAx',
'dynamicVariables' => [
'customer_name' => 'Michael'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.sigmamind.ai/v1/chats/{chatId}"
payload := strings.NewReader("{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.sigmamind.ai/v1/chats/{chatId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sigmamind.ai/v1/chats/{chatId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n }\n}"
response = http.request(request)
puts response.read_body{
"chatId": "chat-d17T6uReChpyfFeP",
"agent": {
"name": "New AI Agent",
"agentId": "agent_D5D0p7TUs66TTAEAx",
"status": "Live"
},
"createdAt": "2021-04-20T10:00:00.000Z",
"status": "ended",
"transcript": "<string>",
"response": [
{
"id": "item_G9YdhDqua0EngI1G",
"role": "assistant",
"type": "message",
"content": [
"Hello! My name is Grace, and I'm calling on behalf of SigmaMind AI. Am I speaking with Michael?"
]
}
],
"messages": [
{
"id": "item_G9YdhDqua0EngI1G",
"role": "assistant",
"type": "message",
"content": [
"Hello! My name is Grace, and I'm calling on behalf of SigmaMind AI. Am I speaking with Michael?"
]
}
],
"dynamicVariables": {
"customer_name": "Michael",
"account_id": "ACC-001"
}
}{
"error": "Bad Request",
"message": "Invalid request parameters",
"path": "/v1/chats",
"status": 400,
"timestamp": "2026-05-05T10:06:43.724Z"
}{
"error": "Unauthorized",
"message": "X-API-Key is missing or invalid",
"path": "/v1/chats",
"status": 401,
"timestamp": "2026-05-05T10:06:43.724Z"
}{
"error": "Forbidden",
"message": "Access denied for this resource",
"path": "/v1/chats",
"status": 403,
"timestamp": "2026-05-05T10:06:43.724Z"
}{
"error": "Not Found",
"message": "The requested resource was not found",
"path": "/v1/chats",
"status": 404,
"timestamp": "2026-05-05T10:06:43.724Z"
}{
"error": "Internal Server Error",
"message": "Unexpected server error",
"path": "/v1/chats",
"status": 500,
"timestamp": "2026-05-05T10:06:43.724Z"
}Update Chat
Partially updates an in_progress chat session by chatId. Only fields provided in the request body are updated — omitted fields remain unchanged. Returns the updated session record.
curl --request PATCH \
--url https://api.sigmamind.ai/v1/chats/{chatId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agentId": "D5D0p7TUs66TTAEAx",
"dynamicVariables": {
"customer_name": "Michael"
}
}
'import requests
url = "https://api.sigmamind.ai/v1/chats/{chatId}"
payload = {
"agentId": "D5D0p7TUs66TTAEAx",
"dynamicVariables": { "customer_name": "Michael" }
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agentId: 'D5D0p7TUs66TTAEAx', dynamicVariables: {customer_name: 'Michael'}})
};
fetch('https://api.sigmamind.ai/v1/chats/{chatId}', 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.sigmamind.ai/v1/chats/{chatId}",
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([
'agentId' => 'D5D0p7TUs66TTAEAx',
'dynamicVariables' => [
'customer_name' => 'Michael'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.sigmamind.ai/v1/chats/{chatId}"
payload := strings.NewReader("{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.sigmamind.ai/v1/chats/{chatId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sigmamind.ai/v1/chats/{chatId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n }\n}"
response = http.request(request)
puts response.read_body{
"chatId": "chat-d17T6uReChpyfFeP",
"agent": {
"name": "New AI Agent",
"agentId": "agent_D5D0p7TUs66TTAEAx",
"status": "Live"
},
"createdAt": "2021-04-20T10:00:00.000Z",
"status": "ended",
"transcript": "<string>",
"response": [
{
"id": "item_G9YdhDqua0EngI1G",
"role": "assistant",
"type": "message",
"content": [
"Hello! My name is Grace, and I'm calling on behalf of SigmaMind AI. Am I speaking with Michael?"
]
}
],
"messages": [
{
"id": "item_G9YdhDqua0EngI1G",
"role": "assistant",
"type": "message",
"content": [
"Hello! My name is Grace, and I'm calling on behalf of SigmaMind AI. Am I speaking with Michael?"
]
}
],
"dynamicVariables": {
"customer_name": "Michael",
"account_id": "ACC-001"
}
}{
"error": "Bad Request",
"message": "Invalid request parameters",
"path": "/v1/chats",
"status": 400,
"timestamp": "2026-05-05T10:06:43.724Z"
}{
"error": "Unauthorized",
"message": "X-API-Key is missing or invalid",
"path": "/v1/chats",
"status": 401,
"timestamp": "2026-05-05T10:06:43.724Z"
}{
"error": "Forbidden",
"message": "Access denied for this resource",
"path": "/v1/chats",
"status": 403,
"timestamp": "2026-05-05T10:06:43.724Z"
}{
"error": "Not Found",
"message": "The requested resource was not found",
"path": "/v1/chats",
"status": 404,
"timestamp": "2026-05-05T10:06:43.724Z"
}{
"error": "Internal Server Error",
"message": "Unexpected server error",
"path": "/v1/chats",
"status": 500,
"timestamp": "2026-05-05T10:06:43.724Z"
}Authorizations
Authenticate every request by passing your API key in the X-API-Key header. To get your key, go to Dashboard → API Keys and create or copy your Production API key.
Path Parameters
Unique identifier of the chat session to update.
Body
The unique identifier of the Agent assigned to handle the chat completion.
64"D5D0p7TUs66TTAEAx"
Dynamic key-value pairs required by the selected Agent for personalisation (e.g. customer name, account details).
Show child attributes
Show child attributes
{ "customer_name": "Michael" }
Response
OK
Unique identity for a chat
"chat-d17T6uReChpyfFeP"
Agent assigned to handle all calls in this campaign. Contains the agent's ID, name, and current status. All contacts in the campaign's contact list will be called using this agent.
Show child attributes
Show child attributes
The timestamp when the call record was created.
"2021-04-20T10:00:00.000Z"
Status of chat
"ended"
transcript of the conversation in chat
Agent response of the last user message
Show child attributes
Show child attributes
[
{
"id": "item_G9YdhDqua0EngI1G",
"role": "assistant",
"type": "message",
"content": [
"Hello! My name is Grace, and I'm calling on behalf of SigmaMind AI. Am I speaking with Michael?"
]
}
]
Agent response of the last user message
Show child attributes
Show child attributes
[
{
"id": "item_G9YdhDqua0EngI1G",
"role": "assistant",
"type": "message",
"content": [
"Hello! My name is Grace, and I'm calling on behalf of SigmaMind AI. Am I speaking with Michael?"
]
}
]
Dynamic key-value pairs that were passed to the agent at call start for personalisation. Keys correspond to variable names defined in the agent's configuration (e.g., 'customer_name', 'account_id'). Null or empty if no dynamic variables were provided when the call was created.
{
"customer_name": "Michael",
"account_id": "ACC-001"
}