Skip to main content
POST
/
v1
/
chats
/
response
Chat Completion
curl --request POST \
  --url https://api.sigmamind.ai/v1/chats/response \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "chatId": "chat_nZ9hHYAANJbhLwZv",
  "input": "Where is my order?"
}
'
{
  "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"
  }
}

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
chatId
string
required

The unique identifier of the chat session in a specific agent.

Required string length: 1 - 128
Example:

"chat_nZ9hHYAANJbhLwZv"

input
string
required

Input message from the customer.

Required string length: 1 - 20480
Example:

"Where is my order?"

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