Developers » API methods » Messages » messages.edit
Edits the message.
You can edit sent message during 24 hours.
This method can be called with a user token received in Standalone-app via Implicit Flow. Access rights required: messages.
This method can be called with a community token. Access rights required: messages.
peer_idDestination ID.

For user:
User ID, e.g. 12345.

For chat:
2000000000 + chat_id, e.g. 2000000001.

For community:
- community ID, e.g. -12345.

int (number), required parameter
message(Required if attachments is not set.) Text of the message.
string, maximum length 9000
latGeographical latitude of a check-in, in degrees (from -90 to 90).
longGeographical longitude of a check-in, in degrees (from -180 to 180).
attachment(Required if message is not set.) List of objects attached to the message, separated by commas, in the following format:

<type> Ś Type of media attachment:
  • photo Ś photo;
  • video Ś video;
  • audio Ś audio;
  • doc Ś document;
  • wall Ś wall post;
  • market Ś market item.
<owner_id> Ś ID of the media attachment owner.
<media_id> Ś media attachment ID.


keep_forward_messages1 Ś to keep forwarded, messages.
flag, either 1 or 0
keep_snippets1 Ś to keep attached snippets.
flag, either 1 or 0
positive number
flag, either 1 or 0, default
message_idMessage ID.
positive number
positive number
JSON data
JSON data
Returns 1.
901Can't send messages for users without permission
909Can't edit this message, because it's too old
910Can't sent this message, because it's too big
911Keyboard format is invalid
912This is a chat bot feature, change this status in settings
914Message is too long
917You don't have access to this chat
920Can't edit this kind of message
940Too many posts in messages
946Chat not supported
949Can't edit pinned message yet
Global errors can occur while running. See their descriptions on this page.