---
title: "Update a message"
url: https://docs.gleap.ai/en/reference/rest-api/update-message
method: PUT
path: "/messages/{messageId}"
api: "API Reference"
tag: "Messages"
operationId: "UpdateMessage"
updatedAt: "2026-11-01T18:40:15.677Z"
language: en
---

# Update a message

`PUT https://api.gleap.io/v3/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.

## Authorization

- `Authorization` (header, required): `Bearer <token>`

## Path parameters

- `messageId` (string, required)

## Headers

- `project` (string, required)

## Request body (`application/json`, required)

- `user` (string)
- `session` (string)
- `bot` (boolean)
- `fallbackUser` (object)
  - `username` (string)
  - `email` (string)
  - `imageUrl` (string)
- `messageRef` (string)
- `ticket` (string)
- `data` (any)
- `translatedData` (any)
- `type` (string)
- `audience` (enum<string>): One of: `requester`, `public`.
- `emailId` (string)
- `sessionNotificationsUnread` (boolean)
- `outbound` (string)
- `outboundTemplate` (string)
- `outboundSubject` (string)
- `status` (any)
- `statusHistory` (any[])
- `comment` (any)
- `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` (any)
- `attachments` (object[])
  - `name` (string, required)
  - `url` (string, required)
  - `type` (string)
- `actions` (object[])
  - `data` (any)
  - `type` (string, required)
- `channel` (object)
  - `id` (string, required)
  - `type` (string)
  - `messageId` (string)
- `sendToChannel` (boolean)
- `isNote` (boolean)
- `rating` (string)

## Example request

```bash
curl --request PUT \
  --url 'https://api.gleap.io/v3/messages/{messageId}' \
  --header 'Authorization: Bearer <token>' \
  --header 'project: <project>' \
  --header 'Content-Type: application/json' \
  --data '{
  "audience": "requester"
}'
```

## Responses

### 200 (`application/json`)

Ok
