---
title: "Chat Completion"
method: POST
path: "/v1/chats/response"
tags: ["Chats"]
---

# Chat Completion

`POST /v1/chats/response`

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.

## Request body

- CreateChatCompletionRequest
  - `chatId` string, required — The unique identifier of the chat session in a specific agent.
  - `input` string, required — Input message from the customer.

## Response `200`

OK

- ChatCompletionResponse
  - `chatId` string — Unique identity for a chat
  - `createdAt` string, date-time — The timestamp when the call record was created.
  - `status` 'in_progress' | 'ended' | 'error' — Status of the chat
  - `response` ChatMessage[] — Agent response of the last user message
    - `id` string — Unique identity for a chat message
    - `role` 'user' | 'assistant' — Role of the chat message
    - `type` 'message' — Type of the chat message
    - `content` string[] — Chat message content
  - `agent` AgentResponse — 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.
    - `name` string — The display name of the assigned agent.
    - `agentId` string — The unique identifier of the agent within the system.
    - `status` 'Live' | 'Testing' | 'Disabled' — The current operational status of the agent.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/sigmamind/apis/sigmamind-apis.md) · [All operations](https://skmtc.net/sigmamind/apis/sigmamind-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sigmamind/sigmamind-apis/versions/d00f52b5123f/schema)
