Edit the caption of an image, video or document
edit_media_captionReplace the caption of an image, video or document this number already sent.
The recipient sees the new caption marked as edited. The file itself
stays exactly as it was and the message keeps its id: only the caption
changes. There is no way to replace the file; to send a different one,
send a new message with send_media.
Only an image, video or document can be edited this way. Audio and
stickers have no caption, and a location, contact card or link button
cannot be edited at all: delete_message is the only change for them.
For the text of a text message use edit_text_message. Using this tool
on any other message answers invalid_request: message_not_editable.
Only a message sent THROUGH Turbo Notify can be edited. One typed on the phone itself belongs to the same number but cannot be edited here, and neither can a message received from someone else.
WhatsApp only accepts a change to a caption within 15 minutes of sending
it. A later edit is refused up front with
invalid_request: edit_window_expired; send a new message instead.
The edit is accepted at once and the outcome arrives as an event:
message.edited when it worked, message.edit.failed when WhatsApp or
the platform could not apply it. Read them with list_events.
The number first appears online and its unread messages in that conversation are marked as read, then the edit happens. Opening the conversation this way is automatic and uses no quota of its own.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caption | Yes | The new caption, up to 1024 characters. It replaces the whole caption. Writing `@<number>` mentions that person, as in a caption on send. | |
| message_id | Yes | Message id (`msg_…`), as returned by a send or by `list_messages`. | |
| number_alias | No | Which of the organization's WhatsApp numbers this acts on: `main`, the alias of an extra number, or the number's `id` (`num_…`), which stays the same when the alias is renamed. Call `list_numbers` to see them. Defaults to the main number. | main |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||