Skip to main content
PATCH
/
v1
/
chats
/
{chatId}
Update Chat
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"
  }
}
'
{
  "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"
  }
}

Authorizations

X-API-Key
string
header
required

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

chatId
string
required

Unique identifier of the chat session to update.

Body

application/json
agentId
string

The unique identifier of the Agent assigned to handle the chat completion.

Maximum string length: 64
Example:

"D5D0p7TUs66TTAEAx"

dynamicVariables
object

Dynamic key-value pairs required by the selected Agent for personalisation (e.g. customer name, account details).

Example:
{ "customer_name": "Michael" }

Response

OK

chatId
string

Unique identity for a chat

Example:

"chat-d17T6uReChpyfFeP"

agent
object

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.

createdAt
string<date-time>

The timestamp when the call record was created.

Example:

"2021-04-20T10:00:00.000Z"

status
string

Status of chat

Example:

"ended"

transcript
string

transcript of the conversation in chat

response
object[]

Agent response of the last user message

Example:
[
{
"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
object[]

Agent response of the last user message

Example:
[
{
"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
object

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.

Example:
{
"customer_name": "Michael",
"account_id": "ACC-001"
}