Delete messages
Messages
Delete messages
Delete a sent or received message from a chat
DELETE
Delete messages
Overview
Method used to delete a message from a chat. You can delete both a message you sent and a message sent by a contact. To use this feature you only need the messageId of the message you want to delete.Example on WhatsApp

Attributes
Header
string
required
Your instance ID. Available in the Z-API panel under Instances.
string
required
Your Z-API instance token.
Query Parameters
string
required
Original message ID
string
required
Recipient/sender phone number (or group ID for group messages) in DDI DDD NUMBER format. E.g.: 551199999999
boolean
required
Set to
true if you sent the message or false if it was a received messageboolean
Set to
true to delete the message only for you (“Delete for me”), keeping it visible to the recipient. If not informed or set to false, the message will be deleted for everyone.Request Example
Example URL
Deleting only for me
To delete the message only “for me,” simply add thedeleteForMe parameter to the delete message endpoint request.