Skip to main content
POST
/
v1
/
chats
Create 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": "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"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.sigmamind.ai/llms.txt

Use this file to discover all available pages before exploring further.

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.

Body

application/json
agentId
string
required

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

Required string length: 1 - 64
Example:

"D5D0p7TUs66TTAEAx"

input
string
required

Input message from the customer or conversation history.

Required string length: 1 - 20480
Example:

"Where is my order?"

dynamicVariables
object

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

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

Unique ID of a previous chat session to use as context for this chat.

Maximum string length: 128
Example:

"chat_D5D0p7TUs66TTAEAx"

Response

Created

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": "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

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.