WSAPI icon

WSAPI

Interact with WSAPI WhatsApp API

Overview

The node provides integration with the WSAPI WhatsApp API, enabling various operations on WhatsApp resources such as chats, messages, contacts, groups, and more. Specifically, for the Chat resource and the Delete Chat operation, this node allows users to delete a specified WhatsApp chat by its unique identifier.

This is useful in scenarios where you want to programmatically manage your WhatsApp chats, for example:

  • Automatically cleaning up old or inactive chats.
  • Removing specific group or individual chats based on business logic.
  • Integrating WhatsApp chat management into broader automation workflows.

Example use case: A customer support system that deletes resolved chat threads after a certain period to keep the workspace clean.

Properties

Name Meaning
Chat ID The unique identifier of the WhatsApp chat to delete. For individual contacts, it is the phone number plus @s.whatsapp.net. For groups, it is the group ID plus @g.us. Example: 1234567890@s.whatsapp.net for an individual chat or 120363123456789@g.us for a group chat.

Output

The node outputs JSON data representing the result of the delete chat operation. Typically, this will include confirmation of the deletion or any relevant status information returned by the WSAPI WhatsApp API.

If the operation supports binary data output (not indicated here), it would represent related media or files, but for deleting a chat, the output is expected to be purely JSON confirming success or failure.

Dependencies

  • Requires an API key credential for authenticating with the WSAPI WhatsApp API.
  • The node expects the base URL of the WSAPI service to be configured in the credentials.
  • No additional external dependencies are required beyond the WSAPI service access.

Troubleshooting

  • Common issues:

    • Invalid or malformed Chat ID: Ensure the chat identifier matches the expected format (phone@s.whatsapp.net for individuals, groupID@g.us for groups).
    • Authentication errors: Verify that the API key credential is correctly set up and has sufficient permissions.
    • Network or connectivity problems: Confirm that the base URL is reachable and the WSAPI service is operational.
  • Error messages:

    • "The resource "chat" is not known!": This indicates an internal misconfiguration; ensure the resource parameter is correctly set to "chat".
    • "The operation "deleteChat" is not implemented yet!": Suggests the operation is not supported or there is a version mismatch; verify node version compatibility.
    • API error responses from WSAPI (e.g., chat not found, permission denied) will be passed through; check the chat ID and API permissions.

Links and References

Discussion