Max icon

Max

Interact with Max messenger

Message → Edit Message

AI-generated

Summary

Edit an existing message in Max messenger by specifying its Message ID and providing new text content with optional formatting and an inline keyboard. Optionally clear all current message attachments including inline keyboard buttons.

Inputs

  • Message ID (required) — The unique identifier of the message to edit.
  • New Message Text (required) — The new text content for the message, up to 4000 characters.
  • Text Format — Format of the message text; choices are Plain Text, HTML, or Markdown.
  • Inline Keyboard — Optional inline keyboard buttons arranged in rows; each button includes text, style, type, and action data.
  • Clear Attachments — Boolean flag indicating whether to remove all existing message attachments and inline keyboard buttons.

Output shape

a single record

Returns the edited message details as JSON. Throws errors if the message cannot be found or if input validation fails (e.g., text length or format). When Clear Attachments is true, all attachments including keyboards are removed; otherwise, optionally replaces the inline keyboard based on the provided button rows.

Examples

Example 1: Edit a message with new markdown formatted text and an updated inline keyboard

Provide the Message ID, new message text with 'markdown' format selected, and define the inline keyboard buttons in rows.

Links

Discussion