Actions55
- Session Actions
- Message Actions
- Chat Actions
- Contact Actions
- Group Actions
- Webhook Actions
- Status Actions
Contact → Block Contact
AI-generatedOverview
This node integrates with the WAHA API to automate WhatsApp interactions. Specifically, for the Contact resource and Block Contact operation, it allows users to block a specified WhatsApp contact programmatically. This is useful in scenarios where you want to automatically manage your contact list by blocking unwanted or spam contacts based on certain triggers or workflows.
Practical examples include:
- Automatically blocking contacts who send spam messages.
- Managing customer support by blocking abusive users.
- Integrating with CRM systems to control communication flow.
Properties
| Name | Meaning |
|---|---|
| Session Name | The name of the WhatsApp session to use for the operation. Defaults to the configured default session. |
| Chat ID | The WhatsApp chat identifier of the contact to block. It should be in the format phoneNumber@c.us (for individual contacts) or groupid@g.us (for groups). This property is required. |
| Additional Fields | A collection of optional fields that can be used to provide extra information depending on the operation. For blocking a contact, this is typically unused but available for other operations. |
Output
The node outputs a JSON object containing the response from the WAHA API after attempting to block the contact. The structure depends on the API's response but generally includes confirmation of the block action or error details if the operation failed.
No binary data output is involved in this operation.
Example output JSON might look like:
{
"success": true,
"message": "Contact blocked successfully",
"contactId": "5511999999999@c.us"
}
Dependencies
- Requires an active WAHA API credential with a valid base URL and API key.
- Optionally uses an additional API key credential for N8N Tools API validation.
- The node requires proper configuration of WhatsApp sessions within WAHA API.
- Network access to the WAHA API endpoint must be available.
Troubleshooting
- Invalid Credentials: If the API key or session name is incorrect, the node will throw authentication errors. Verify credentials and session names.
- Unknown Contact ID Format: Ensure the Chat ID is correctly formatted as
phoneNumber@c.us. - API Validation Errors: The node performs a validation call to the N8N Tools API before executing. If this fails with 401 or 403 status codes, check subscription status and API keys.
- Operation Not Supported: If the operation or resource is misspelled or unsupported, the node throws an error indicating unknown operation/resource.
- Network Issues: Timeouts or connection errors may occur if the WAHA API service is unreachable.
Links and References
- WAHA API Documentation (replace with actual URL)
- WhatsApp Business API Overview
- n8n Documentation
Note: The above summary is based on static analysis of the provided source code and input properties for the Contact resource's Block Contact operation.