---
title: "Update a message"
method: PUT
path: "/messages/{messageId}"
tags: ["Messages"]
---

# Update a message

`PUT /messages/{messageId}`

Edit an existing message. Only `data` (the message content, e.g. `data.content` as TipTap JSON) and
`attachments` are persisted; all other schema properties are ignored, and `data` is replaced wholesale
(an omitted `data` clears the content). Agents may only edit their own messages, sent through the widget
or email channel, that the contact has not read yet and that are less than 2 minutes old; own internal
notes can be edited at any time.

## Path parameters

- `messageId` string, required

## Headers

- `project` string, required

## Request body

- UpdateMessageDto
  - `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)
