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.
Attributes
Your instance ID. Available in the Z-API panel under Instances.
Your Z-API instance token.
Query Parameters
Recipient/sender phone number (or group ID for group messages) in DDI DDD NUMBER format. E.g.: 551199999999
Set to true if you sent the message or false if it was a received message
Request Example
Example URL
DELETE https://api.z-api.io/instances/{instanceId}/token/{instanceToken}/messages?messageId=123&phone=5511999998888&owner=true
Response
204
No content
405
Make sure you are correctly sending the method specification, that is, verify that you sent DELETE as specified at the beginning of this topic.
415
If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.