WSAPI icon

WSAPI

Interact with WSAPI WhatsApp API

Overview

The node provides integration with the WSAPI WhatsApp API, enabling various WhatsApp messaging operations. Specifically, for the Edit Message operation under the Message resource, it allows users to update the text content of an existing WhatsApp message. This is useful in scenarios where a sent message contains errors or needs clarification without sending a new message.

Practical examples include:

  • Correcting typos or mistakes in a previously sent message.
  • Updating information in a message after receiving new details.
  • Modifying automated notifications or alerts that were sent prematurely.

Note: Only text messages can be edited on WhatsApp using this operation.

Properties

Name Meaning
To The WhatsApp contact ID or group ID to which the message belongs. For contacts, use the phone number followed by @s.whatsapp.net (e.g., 1234567890@s.whatsapp.net). For groups, use the group ID followed by @g.us.
Message ID The unique identifier of the WhatsApp message to edit. This ID must be obtained from previous WhatsApp operations or webhook events.
New Message The updated text content for the message. Only text messages are editable; provide the new message text here.

Output

The output JSON contains the response from the WSAPI WhatsApp API after attempting to edit the message. Typically, this includes confirmation of the edit operation and any relevant metadata about the updated message.

If the operation fails, the output may contain error information describing what went wrong.

This node does not output binary data for the Edit Message operation.

Dependencies

  • Requires an active connection to the WSAPI WhatsApp API via an API key credential configured in n8n.
  • The base URL for the WSAPI endpoint must be set in the credentials.
  • The node depends on the WSAPI service being available and reachable.

Troubleshooting

  • Common Issues:

    • Invalid or missing To field format (must include country code and correct suffix).
    • Incorrect or expired Message ID.
    • Attempting to edit non-text messages will fail because WhatsApp only supports editing text messages.
    • Network or authentication issues with the WSAPI service.
  • Error Messages:

    • "The operation "editMessage" is not implemented yet!": Indicates the operation handler was not found; ensure the node version supports this operation.
    • Errors related to invalid message IDs or permissions typically come from the WSAPI API and should be resolved by verifying the message exists and belongs to the specified contact/group.
    • Authentication errors suggest checking the API key credential configuration.

Links and References

Discussion