curl --request POST \
--url https://api.sigmamind.ai/v1/chats \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agentId": "D5D0p7TUs66TTAEAx",
"input": "Where is my order?",
"dynamicVariables": {
"customer_name": "Michael"
},
"previousChatId": "chat_D5D0p7TUs66TTAEAx"
}
'import requests
url = "https://api.sigmamind.ai/v1/chats"
payload = {
"agentId": "D5D0p7TUs66TTAEAx",
"input": "Where is my order?",
"dynamicVariables": { "customer_name": "Michael" },
"previousChatId": "chat_D5D0p7TUs66TTAEAx"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: 'D5D0p7TUs66TTAEAx',
input: 'Where is my order?',
dynamicVariables: {customer_name: 'Michael'},
previousChatId: 'chat_D5D0p7TUs66TTAEAx'
})
};
fetch('https://api.sigmamind.ai/v1/chats', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => 'D5D0p7TUs66TTAEAx',
'input' => 'Where is my order?',
'dynamicVariables' => [
'customer_name' => 'Michael'
],
'previousChatId' => 'chat_D5D0p7TUs66TTAEAx'
]),
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"
payload := strings.NewReader("{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"input\": \"Where is my order?\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n },\n \"previousChatId\": \"chat_D5D0p7TUs66TTAEAx\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sigmamind.ai/v1/chats")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"input\": \"Where is my order?\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n },\n \"previousChatId\": \"chat_D5D0p7TUs66TTAEAx\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sigmamind.ai/v1/chats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"input\": \"Where is my order?\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n },\n \"previousChatId\": \"chat_D5D0p7TUs66TTAEAx\"\n}"
response = http.request(request)
puts response.read_body{
"chatId": "chat_d17T6uReChpyfFeP",
"createdAt": "2021-04-20T10:00:00.000Z",
"status": "ended",
"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?"
]
}
],
"agent": {
"name": "New AI Agent",
"agentId": "agent_D5D0p7TUs66TTAEAx",
"status": "Live"
}
}{
"error": "Bad Request",
"message": "Invalid request parameters",
"path": "/v1/chats",
"status": 400,
"timestamp": "2026-05-05T10:06:43.615Z"
}{
"error": "Unauthorized",
"message": "X-API-Key is missing or invalid",
"path": "/v1/chats",
"status": 401,
"timestamp": "2026-05-05T10:06:43.615Z"
}{
"error": "Forbidden",
"message": "Access denied for this resource",
"path": "/v1/chats",
"status": 403,
"timestamp": "2026-05-05T10:06:43.615Z"
}{
"error": "Not Found",
"message": "The requested resource was not found",
"path": "/v1/chats",
"status": 404,
"timestamp": "2026-05-05T10:06:43.615Z"
}{
"error": "Internal Server Error",
"message": "Unexpected server error",
"path": "/v1/chats",
"status": 500,
"timestamp": "2026-05-05T10:06:43.615Z"
}Create Chat
Creates a new chat session with the specified agent and sends the initial message. Returns the agent’s reply along with the chatId for subsequent completion, update, and end-session calls.
curl --request POST \
--url https://api.sigmamind.ai/v1/chats \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agentId": "D5D0p7TUs66TTAEAx",
"input": "Where is my order?",
"dynamicVariables": {
"customer_name": "Michael"
},
"previousChatId": "chat_D5D0p7TUs66TTAEAx"
}
'import requests
url = "https://api.sigmamind.ai/v1/chats"
payload = {
"agentId": "D5D0p7TUs66TTAEAx",
"input": "Where is my order?",
"dynamicVariables": { "customer_name": "Michael" },
"previousChatId": "chat_D5D0p7TUs66TTAEAx"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: 'D5D0p7TUs66TTAEAx',
input: 'Where is my order?',
dynamicVariables: {customer_name: 'Michael'},
previousChatId: 'chat_D5D0p7TUs66TTAEAx'
})
};
fetch('https://api.sigmamind.ai/v1/chats', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => 'D5D0p7TUs66TTAEAx',
'input' => 'Where is my order?',
'dynamicVariables' => [
'customer_name' => 'Michael'
],
'previousChatId' => 'chat_D5D0p7TUs66TTAEAx'
]),
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"
payload := strings.NewReader("{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"input\": \"Where is my order?\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n },\n \"previousChatId\": \"chat_D5D0p7TUs66TTAEAx\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sigmamind.ai/v1/chats")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"input\": \"Where is my order?\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n },\n \"previousChatId\": \"chat_D5D0p7TUs66TTAEAx\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sigmamind.ai/v1/chats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"D5D0p7TUs66TTAEAx\",\n \"input\": \"Where is my order?\",\n \"dynamicVariables\": {\n \"customer_name\": \"Michael\"\n },\n \"previousChatId\": \"chat_D5D0p7TUs66TTAEAx\"\n}"
response = http.request(request)
puts response.read_body{
"chatId": "chat_d17T6uReChpyfFeP",
"createdAt": "2021-04-20T10:00:00.000Z",
"status": "ended",
"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?"
]
}
],
"agent": {
"name": "New AI Agent",
"agentId": "agent_D5D0p7TUs66TTAEAx",
"status": "Live"
}
}{
"error": "Bad Request",
"message": "Invalid request parameters",
"path": "/v1/chats",
"status": 400,
"timestamp": "2026-05-05T10:06:43.615Z"
}{
"error": "Unauthorized",
"message": "X-API-Key is missing or invalid",
"path": "/v1/chats",
"status": 401,
"timestamp": "2026-05-05T10:06:43.615Z"
}{
"error": "Forbidden",
"message": "Access denied for this resource",
"path": "/v1/chats",
"status": 403,
"timestamp": "2026-05-05T10:06:43.615Z"
}{
"error": "Not Found",
"message": "The requested resource was not found",
"path": "/v1/chats",
"status": 404,
"timestamp": "2026-05-05T10:06:43.615Z"
}{
"error": "Internal Server Error",
"message": "Unexpected server error",
"path": "/v1/chats",
"status": 500,
"timestamp": "2026-05-05T10:06:43.615Z"
}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.
Body
The unique identifier of the Agent assigned to handle the chat completion.
1 - 64"D5D0p7TUs66TTAEAx"
Input message from the customer or conversation history.
1 - 20480"Where is my order?"
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" }
Unique ID of a previous chat session to use as context for this chat.
128"chat_D5D0p7TUs66TTAEAx"
Response
Created
Unique identity for a chat
"chat_d17T6uReChpyfFeP"
The timestamp when the call record was created.
"2021-04-20T10:00:00.000Z"
Status of the chat
in_progress, ended, error "ended"
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 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