---
title: "Create a new message"
method: POST
path: "/messages"
tags: ["Messages"]
---

# Create a new message

`POST /messages`

Create a new message in a ticket. Required field: `ticket` (ticket ID).
Optional fields: `comment` (rich text as TipTap doc JSON, or a plain string) or `markdownComment`
(Markdown, converted server-side; takes precedence over `comment`), `type` (defaults to `TEXT`, or `NOTE`
when `isNote` is true), `isNote` (creates an internal note), `attachments` (array of `{ name, url, type }`),
`channel`, `replyTo` (message ID to quote), `data`, and `actions`. Other schema properties are accepted for
backwards compatibility but are ignored on create; messages are always attributed to the authenticated
user.

## Headers

- `project` string, required

## Request body

- CreateMessageDto
  - `user` string
  - `session` string
  - `bot` boolean
  - `fallbackUser` FallbackUserDto
    - `username` string
    - `email` string
    - `imageUrl` string
  - `messageRef` string
  - `ticket` string
  - `data` unknown
  - `translatedData` unknown
  - `type` string
  - `emailId` string
  - `sessionNotificationsUnread` boolean
  - `outbound` string
  - `outboundTemplate` string
  - `outboundSubject` string
  - `status` unknown
  - `statusHistory` unknown[]
    - unknown
  - `comment` unknown
  - `markdownComment` string — Markdown message body, honored when creating a message: the server converts it to TipTap JSON and it takes precedence over `comment`. Ignored when updating a message.
  - `replyTo` string
  - `kaiChat` boolean
  - `aiData` unknown
  - `attachments` AttachmentDto[]
    - `name` string, required
    - `url` string, required
    - `type` string
  - `actions` object[]
    - `data` unknown
    - `type` string, required
  - `channel` ChannelDto
    - `id` string, required
    - `type` string
    - `messageId` string
  - `sendToChannel` boolean
  - `isNote` boolean
  - `rating` string

## Response `200`

Ok

- unknown

---

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