---
title: "Create a new chat message in a thread"
method: POST
path: "/api/v5/admin/ai-chat/messages"
tags: ["AI Chat"]
---

# Create a new chat message in a thread

`POST /api/v5/admin/ai-chat/messages`

Create a new message in a specific thread.

## Query parameters

- `thread_id` integer, required — The ID of the chat thread

## Request body

- BodyAiChatMessagesAdminCreateApiV5AdminAiChatMessagesPost
  - `message` AiChatMessageInCreate, required
    - `threadId` integer
    - `role` string — Role of the message sender (e.g., user, bot)
    - `content` string — Full message content
    - `displayContent` string — Message content to be displayed
    - `hidden` boolean — Flag to hide/show the message
    - `functionName` string — Tools function name
    - `toolCalls` object[] — Tool calls
    - `toolCallId` string — Tool call id

## Response `201`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pavlok/apis/pavlok-api-v5.md) · [All operations](https://skmtc.net/pavlok/apis/pavlok-api-v5/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pavlok/pavlok-api-v5/revisions/3d192098b1ac/schema)
