MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Chat → Delete Message

AI-generated

Overview

This node operation deletes a specific message from a WhatsApp chat. It is useful when you want to remove a message that was previously sent by your WhatsApp instance. For example, if you sent a message by mistake or want to retract information, you can delete that message using this operation.

Use Case Examples

  1. Deleting a mistakenly sent message in a customer support chat.
  2. Removing outdated information from a group chat where your instance sent the message.

Properties

Name Meaning
To (Contact) The WhatsApp contact where the message should be deleted. It requires the phone number in the format phone_number@s.whatsapp.net (e.g., 551199999999@s.whatsapp.net).
Key (JSON) The message key object containing remoteJid, fromMe, and ID fields to identify the message to delete. This key is typically obtained from webhook events.

Output

JSON

  • status - The status of the delete message operation, indicating success or failure.
  • message - Additional information or confirmation about the deletion.

Dependencies

  • Requires an API key credential for MegaAPI WhatsApp service authentication.

Troubleshooting

  • Ensure the 'to' contact is correctly formatted as phone_number@s.whatsapp.net.
  • The message key must be accurate and correspond to a message sent by your instance (fromMe: true).
  • If the message was not sent by your instance, deletion will fail as only messages sent by your instance can be deleted.
  • Common error: 'Unknown chat operation' if the operation parameter is incorrect; verify the operation name is 'deleteMessage'.
  • API authentication errors may occur if the API token is missing or invalid; ensure credentials are properly configured.

Discussion