Actions17
Overview
This node enables deleting a specific WhatsApp message using the Z-API WhatsApp service. It is useful in scenarios where you want to programmatically remove messages from a chat or group, for example, to moderate conversations, retract sent messages, or automate cleanup tasks.
A practical example: You have an automated system that sends notifications via WhatsApp but needs to delete certain messages after a condition is met (e.g., outdated alerts). This node can delete those messages by specifying their ID and the chat they belong to.
Properties
| Name | Meaning |
|---|---|
| Instance | Your Z-API instance ID used to identify your WhatsApp API instance. |
| Token | Your Z-API token for authenticating API requests. |
| Client Token | Your Z-API client token for additional authentication header required by the API. |
| Message ID | The unique identifier of the message you want to delete. |
| Phone | The phone number or group ID where the message is located. |
| Owner | Boolean indicating whether you are the owner of the message (true/false). |
Output
The output is a JSON object representing the response from the Z-API server after attempting to delete the message. It typically contains status information about the deletion operation, such as success confirmation or error details.
No binary data is output by this operation.
Example output structure (simplified):
{
"status": "success",
"message": "Message deleted successfully"
}
or in case of failure:
{
"status": "error",
"message": "Message not found or cannot be deleted"
}
Dependencies
- Requires access to the Z-API WhatsApp service.
- Needs valid credentials: an instance ID, a token, and a client token.
- The node makes HTTP DELETE requests to the Z-API endpoint
https://api.z-api.io/instances/{instance}/token/{token}/messages. - Proper network connectivity to the Z-API service is necessary.
Troubleshooting
Common issues:
- Invalid or expired tokens causing authentication failures.
- Incorrect message ID or phone/group ID leading to "message not found" errors.
- Insufficient permissions if the "owner" flag is set incorrectly.
- Network connectivity problems preventing API calls.
Error messages and resolutions:
"401 Unauthorized": Check that the instance ID, token, and client token are correct and active."404 Not Found"or message-related errors: Verify the message ID and phone/group ID are accurate."403 Forbidden": Ensure you have permission to delete the message; confirm the "owner" property matches your ownership status.- Timeout or network errors: Confirm internet connection and that the Z-API service is reachable.
Links and References
- Z-API Official Documentation (for detailed API usage and authentication)
- WhatsApp Business API Guidelines (general reference on message management)