Green API icon

Green API

Send WhatsApp messages via Green API

Overview

This node enables interaction with WhatsApp messaging via the Green API service. Specifically, for the Message resource and Delete Message operation, it allows users to delete a specific WhatsApp message from a chat. This can be useful in scenarios where you want to programmatically remove messages either from both sender and receiver sides or only from the sender's side.

Practical examples include:

  • Automatically deleting sensitive messages after a certain workflow step.
  • Removing mistakenly sent messages.
  • Managing message cleanup in automated chatbots or customer support systems.

Properties

Name Meaning
Message ID The unique identifier of the message to delete.
Delete for Sender Only Boolean option indicating whether to delete the message only from the sender's view (true) or from all participants (false).

Output

The node outputs a JSON array containing the response from the Green API after attempting to delete the message. The structure typically includes confirmation details about the deletion status. No binary data is output by this operation.

Example output snippet (conceptual):

[
  {
    "result": "success",
    "idMessage": "BAE5367237E13A87"
  }
]

Dependencies

  • Requires an active Green API account with valid credentials: an instance ID and an API token.
  • The node makes HTTP POST requests to the Green API endpoints.
  • Proper credential configuration in n8n is necessary to authenticate API calls.

Troubleshooting

  • Common issues:

    • Invalid or missing Message ID will cause the operation to fail.
    • Incorrect or expired API credentials will result in authentication errors.
    • Attempting to delete a message that does not exist or has already been deleted may return an error.
  • Error messages:

    • "Failed to delete message: <error message>" indicates the API call failed; check the message ID and credentials.
    • Errors including Data sent: show the payload sent to the API, useful for debugging incorrect parameters.
  • Resolutions:

    • Verify the Message ID is correct and corresponds to a message in the specified chat.
    • Ensure API credentials are correctly set up and have sufficient permissions.
    • Confirm network connectivity and API endpoint availability.

Links and References

  • Green API Documentation – Official API docs for message operations.
  • WhatsApp Messaging Concepts – For understanding message IDs and deletion behavior in WhatsApp.

Discussion