Green API icon

Green API

Send WhatsApp messages via Green API

Message → Delete Message

AI-generated

Overview

This node operation deletes a specific message from a WhatsApp chat using the Green API. It is useful for scenarios where you need to remove a message either from both sender and receiver sides or only from the sender's side. For example, you might want to delete a mistakenly sent message or remove sensitive information from a chat.

Use Case Examples

  1. Deleting a message from a private chat by specifying the chat ID and message ID.
  2. Deleting a message from a group chat by providing the group chat ID and message ID.
  3. Choosing to delete the message only from the sender's side to keep it visible to other participants.

Properties

Name Meaning
Chat ID The identifier of the chat from which the message will be deleted. For private chats, use phone@c.us format; for group chats, use chatId@g.us.
Message ID The unique identifier of the message to be deleted.
Delete for Sender Only Boolean flag indicating whether the message should be deleted only from the sender's side.

Output

JSON

  • chatId - The chat ID from which the message was deleted.
  • idMessage - The ID of the deleted message.
  • onlySenderDelete - Indicates if the message was deleted only from the sender's side.
  • result - The response result from the Green API confirming the deletion status.

Dependencies

  • Green API credentials including instance ID and API token for authentication.

Troubleshooting

  • Ensure the chat ID and message ID are correctly specified; incorrect IDs will cause deletion to fail.
  • If deleting only from the sender side, verify that the API and WhatsApp client support this feature.
  • Check that the provided API credentials (instance ID and API token) are valid and have the necessary permissions.
  • Common error messages include failures to delete due to invalid message ID or insufficient permissions; verify the data sent matches the expected format.

Links

Discussion