Skip to main content
POST
/
v1
/
chats
Create a Chat
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"
}
'
{
  "chatId": "chat-d17T6uReChpyfFeP",
  "createdAt": "2021-04-20T10:00:00.000Z",
  "status": "ended",
  "response": [
    {
      "id": "chat-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": "D5D0p7TUs66TTAEAx",
    "status": "active"
  }
}

Authorizations

X-API-Key
string
header
required

API Key is required in header. You can find it in the settings

Body

application/json
agentId
string
required

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

Example:

"D5D0p7TUs66TTAEAx"

input
string
required

Input message of the customer or history of the conversation

Example:

"Where is my order?"

dynamicVariables
object

A set of dynamic key-value pairs required by the selected Agent. These variables allow personalization of the call, such as passing the customer’s name or other contextual details.

Example:
{ "customer_name": "Michael" }
previousChatId
string

Unique ID of the chat that will be used as context for the new chat.

Example:

"chat-D5D0p7TUs66TTAEAx"

Response

OK

chatId
string

Unique identity for a chat

Example:

"chat-d17T6uReChpyfFeP"

createdAt
string<date-time>

The timestamp when the call record was created.

Example:

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

status
enum<string>

Status of the chat

Available options:
in-progress, ended, error
Example:

"ended"

response
object[]

Agent response of the last user message

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

Assigned agent for current campaign