v3

latestOpenAPI 3.1.02026-08-01264769.0 KB
Bot

Edit message text

Replaces the text and formatting of a message in a private conversation or chat. On success, returns the updated message.

post/bot{token}/editMessageText

Path parameters

tokenstring required

Required bot token included in the URL path.

Headers

authorizationstring

Optional bot token using the Bearer scheme. When supplied, it takes precedence over the token in the URL.

Request body

user_idinteger

Target a private conversation with this user. Supply exactly one of user_id or chat_id.

chat_idinteger

Target this chat. Supply exactly one of chat_id or user_id.

message_idinteger required

Message to edit in the target chat.

textstring required

New text for the message.

parse_markdownboolean

Parse supported Markdown formatting from the new text.

Response

Successful sendMessage or editMessageText response.

oktrue required

Always true for a successful request.

Example response

{
  "ok": true,
  "result": {
    "message": {
      "message_id": 1808,
      "chat_id": 73143,
      "chat": {
        "chat_id": 73143,
        "title": "Maya Chen",
        "is_public": false,
        "last_message_id": 1808,
        "last_message": {
          "message_id": 1808,
          "from_id": 284901,
          "from": {
            "id": 284901,
            "is_bot": true,
            "username": "deploy_bot",
            "first_name": "Deploy Bot"
          },
          "date": 1784332860,
          "text": "Deployment finished successfully.",
          "entities": [
            {
              "type": "bold",
              "offset": 0,
              "length": 10
            }
          ]
        }
      },
      "peer": {
        "user_id": 391204
      },
      "from_id": 284901,
      "from": {
        "id": 284901,
        "is_bot": true,
        "username": "deploy_bot",
        "first_name": "Deploy Bot"
      },
      "date": 1784332860,
      "text": "Deployment finished successfully.",
      "entities": [
        {
          "type": "bold",
          "offset": 0,
          "length": 10
        }
      ]
    }
  }
}