Actions29
- Chat Actions
- Group Actions
- Instance Actions
- Message Actions
- Webhook Actions
Overview
The "Leave Group" operation in the MegaAPI node allows your WhatsApp instance to leave a specified WhatsApp group. This is useful when you want to programmatically remove the instance from group conversations, for example, to stop receiving messages or notifications from that group. Once the instance leaves the group, it will no longer be part of the conversation and must be re-invited to join again.
Practical examples:
- Automatically leaving groups after a certain event or time period.
- Managing group memberships dynamically based on business logic.
- Cleaning up group memberships to reduce noise or irrelevant chats.
Properties
| Name | Meaning |
|---|---|
| Group JID | The unique identifier of the WhatsApp group to leave. Format: group_id@g.us (e.g., 120363042979163716@g.us). |
| Information | A notice explaining that this operation will make the WhatsApp instance leave the specified group and that the response includes the operation status. It also warns that re-invitation is required to rejoin. |
Output
The output JSON contains the result of the leave group operation, typically including the status of the request such as success confirmation or error details if the operation failed. This lets you verify whether the instance successfully left the group.
The node does not output binary data for this operation.
Dependencies
- Requires an active connection to the MegaAPI WhatsApp service.
- Requires valid API credentials (an API key/token) configured in n8n to authenticate requests.
- The base URL and authorization token must be set correctly in the node credentials.
Troubleshooting
Common issues:
- Invalid or malformed Group JID: Ensure the group ID follows the correct format (
group_id@g.us). - Attempting to leave a group the instance is not a member of may cause errors.
- Network or authentication failures due to incorrect API credentials or connectivity issues.
- Invalid or malformed Group JID: Ensure the group ID follows the correct format (
Error messages:
"Unknown group operation: leaveGroup": Indicates a misconfiguration or internal error; ensure the operation name is correct.- API errors returned from the WhatsApp service will be included in the output JSON under an error field.
Resolutions:
- Double-check the Group JID input.
- Verify API credentials and network connectivity.
- Handle errors gracefully using the node's "Continue On Fail" option if needed.
Links and References
- WhatsApp Group JID Format Explanation
- MegaAPI official documentation (refer to your API provider's docs for detailed usage)