Overview
You can delete messages from a chat for all participants. This works similar to the “Delete for Everyone” feature in WhatsApp.
Deleted messages cannot be recovered. This action is permanent for all chat participants.
WhatsApp has a time limit for deleting messages (typically around 2 days). Messages older than this limit cannot be deleted for everyone.
Authentication
This endpoint requires authentication via the apikey header.
Your Evolution API key for authentication.
Path Parameters
The name of your WhatsApp instance.
Request Body
The unique message ID to delete.
The WhatsApp JID of the chat containing the message.
Whether the message was sent by you. Set to true for messages you sent, false for received messages.
For group chats only: the JID of the participant who sent the message. Required when deleting group messages.
Response
Confirmation that the message was deleted.
The ID of the deleted message.
curl --request DELETE \
--url https://api.example.com/chat/deleteMessageForEveryone/my-instance \
--header 'apikey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"id": "3EB0123456789ABCDEF",
"remoteJid": "[email protected]",
"fromMe": true
}'
{
"deleted": true,
"messageId": "3EB0123456789ABCDEF"
}
Usage Notes
You can only delete messages that you sent (fromMe: true). Attempting to delete messages sent by others will fail.
For group messages, always include the participant field to specify who sent the message.
If the message is older than WhatsApp’s deletion time limit (approximately 2 days), the deletion will fail.