## Edit a message

`$client->messages->update(string messageID, string chatID, string text): MessageUpdateResponse`

**put** `/v1/chats/{chatID}/messages/{messageID}`

Edit the text content of an existing message. Messages with attachments cannot be edited.

### Parameters

- `chatID: string`

  Chat ID. Input routes also accept the local chat ID from this installation when available.

- `messageID: string`

  Message ID.

- `text: string`

  New text content for the message

### Returns

- `MessageUpdateResponse`

  - `string id`

    Message ID.

  - `string accountID`

    Beeper account ID the message belongs to.

  - `string chatID`

    Chat ID. Input routes also accept the local chat ID from this installation when available.

  - `string senderID`

    Fully qualified sender user ID. Network-backed IDs usually include the network prefix and homeserver.

  - `string sortKey`

    A unique, sortable key used to sort messages.

  - `\Datetime timestamp`

    Message timestamp.

  - `?list<Attachment> attachments`

    Attachments included with this message, if any.

  - `?\Datetime editedTimestamp`

    Timestamp when the message was edited, if known.

  - `?bool isDeleted`

    True if the message has been deleted.

  - `?bool isHidden`

    True if the message is hidden from normal display.

  - `?bool isSender`

    True if the authenticated user sent the message.

  - `?bool isUnread`

    True if the message is unread for the authenticated user. May be omitted.

  - `?string linkedMessageID`

    ID of the message this is a reply to, if any.

  - `?list<LinkPreview> links`

    Link previews included with this message, if any.

  - `?list<string> mentions`

    Mentioned user IDs, @room, or null for legacy messages that require text scanning.

  - `?list<Reaction> reactions`

    Reactions to the message, if any.

  - `?Seen seen`

    Read receipt state for this message, when available.

  - `?string senderName`

    Resolved sender display name.

  - `?SendStatus sendStatus`

    Message send status for this message, when reported by the bridge.

  - `?string text`

    Rich-text message body if present.

  - `?Type type`

    Message content type. Useful for distinguishing reactions, media messages, and state events from regular text messages.

  - `string messageID`

    DEPRECATED - use id instead. Compatibility alias for older clients.

  - `true success`

    DEPRECATED - compatibility field. Successful responses are already represented by the 200 status code.

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(accessToken: 'My Access Token');

$message = $client->messages->update(
  '1343993', chatID: '!NCdzlIaMjZUmvmvyHU:beeper.com', text: 'x'
);

var_dump($message);
```

#### Response

```json
{
  "id": "1343993",
  "accountID": "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc",
  "chatID": "!whatsapp_15550101002:ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc.local-whatsapp.localhost",
  "senderID": "@ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc:local-whatsapp.localhost",
  "sortKey": "aaaa1",
  "timestamp": "2025-08-28T11:04:29.621Z",
  "attachments": [
    {
      "type": "unknown",
      "id": "id",
      "duration": 0,
      "fileName": "fileName",
      "fileSize": 0,
      "isGif": true,
      "isSticker": true,
      "isVoiceNote": true,
      "mimeType": "mimeType",
      "posterImg": "posterImg",
      "size": {
        "height": 0,
        "width": 0
      },
      "srcURL": "srcURL",
      "transcription": {
        "engine": "engine",
        "transcription": "transcription",
        "language": "language"
      }
    }
  ],
  "editedTimestamp": "2025-08-31T23:30:12.520Z",
  "isDeleted": false,
  "isHidden": true,
  "isSender": true,
  "isUnread": false,
  "linkedMessageID": "1343993",
  "links": [
    {
      "title": "title",
      "url": "url",
      "favicon": "favicon",
      "img": "img",
      "imgSize": {
        "height": 0,
        "width": 0
      },
      "originalURL": "originalURL",
      "summary": "summary"
    }
  ],
  "mentions": [
    "@discord_337451892017545216:beeper.com"
  ],
  "reactions": [
    {
      "id": "id",
      "participantID": "participantID",
      "reactionKey": "reactionKey",
      "emoji": true,
      "imgURL": "imgURL"
    }
  ],
  "seen": true,
  "senderName": "Adam Van Ymeren",
  "sendStatus": {
    "status": "SUCCESS",
    "timestamp": "2025-08-31T23:30:12.520Z",
    "deliveredToUsers": [
      "string"
    ],
    "internalError": "internalError",
    "message": "message",
    "reason": "reason"
  },
  "text": "Updated message text",
  "type": "TEXT",
  "messageID": "1343993",
  "success": true
}
```
