v1

latestOpenAPI 3.0.12026-07-226992320.0 KB
Chats

Chat Completion

Submits a new customer message to an in_progress chat session and returns the agent's reply. The session must be active — calls against an ended session will be rejected. Returns the agent's response and updated session state.

post/v1/chats/response

Request body

chatIdstring required

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

inputstring required

Input message from the customer.

Example request

{
  "chatId": "chat_nZ9hHYAANJbhLwZv",
  "input": "Where is my order?"
}

Response

OK

chatIdstring

Unique identity for a chat

createdAtstring date-time

The timestamp when the call record was created.

status'in_progress' | 'ended' | 'error'

Status of the chat

Example response

{
  "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"
  }
}