Actions50
- Message Actions
- Contact Actions
- Account Actions
- Call Actions
- Chat Actions
- Group Actions
- Instance Actions
- Media Actions
- Session Actions
- User Actions
Overview
The node integrates with the WSAPI WhatsApp API to manage WhatsApp chats programmatically. Specifically, the Set Ephemeral operation for the Chat resource allows users to configure automatic message deletion timers on a chat. This means messages in the specified chat will be automatically deleted after a set period, enhancing privacy and reducing chat clutter.
Common scenarios where this node is beneficial include:
- Automatically clearing sensitive information from chats after a certain time.
- Managing group chats by setting ephemeral messages to keep conversations fresh.
- Enforcing company policies on message retention within WhatsApp communications.
For example, a user can set ephemeral messages to disappear after 24 hours in a customer support group chat, ensuring that old queries do not linger indefinitely.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The unique identifier of the WhatsApp chat. 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 or 120363123456789@g.us. |
| Ephemeral Expiration (Seconds) | Sets the duration after which messages in the chat are automatically deleted. Options: Off (messages never auto-delete), 24 Hours, 7 Days, 90 Days. |
Output
The node outputs JSON data representing the result of the ephemeral setting operation on the specified chat. Typically, this includes confirmation of the update or details about the chat's new ephemeral message timer setting.
If binary data were involved (not indicated here), it would represent media or files related to the chat, but this operation focuses solely on JSON responses confirming the ephemeral timer status.
Dependencies
- Requires an active connection to the WSAPI WhatsApp API.
- Needs an API key credential configured in n8n to authenticate requests.
- The base URL for the WSAPI must be set in the credentials configuration.
- No additional external dependencies beyond the WSAPI service.
Troubleshooting
- Invalid Chat ID: If the chat ID format is incorrect or the chat does not exist, the node may return an error. Ensure the chat ID matches the required format (
phone@s.whatsapp.netfor individuals,groupID@g.usfor groups). - Permission Issues: Setting ephemeral messages might require appropriate permissions on the WhatsApp account or group. Errors indicating lack of permission suggest checking account rights.
- API Connectivity: Network issues or incorrect API credentials can cause failures. Verify the API key and base URL are correctly configured.
- Unsupported Operation: If the operation is not implemented or recognized, ensure the node version supports the "setEphemeral" operation for the chat resource.