MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Overview

The node provides integration with the MegaAPI WhatsApp service, enabling various operations on WhatsApp instances, chats, groups, messages, and webhooks. Specifically, for the Instance - Logout operation, the node logs out from a connected WhatsApp instance. This is useful when you want to terminate the session of a WhatsApp instance programmatically, for example, to switch accounts, enforce security policies, or reset the connection.

Practical scenarios include:

  • Automating logout of WhatsApp sessions in multi-account management.
  • Logging out before restarting or reconfiguring an instance.
  • Ensuring cleanup of active sessions during maintenance workflows.

Properties

Name Meaning
Informações A warning notice displayed to the user; typically used to show important information or cautions related to the logout operation.

Note: The "Informações" property is a notice type with a warning theme and does not accept input but displays information to the user.

Output

The node outputs JSON data representing the result of the logout operation. Typically, this will include confirmation that the logout was successful or details about the logout process. The exact structure depends on the API response from the MegaAPI service.

No binary data output is associated with the logout operation.

Dependencies

  • Requires an API key credential for authenticating with the MegaAPI WhatsApp service.
  • The node uses the base URL and token from the configured credentials to make authenticated HTTP requests.
  • No additional environment variables are explicitly required beyond the API authentication setup.

Troubleshooting

  • Common Issues:

    • Invalid or expired API token may cause authentication failures.
    • Attempting to logout when no active WhatsApp instance session exists could result in errors.
    • Network connectivity issues can prevent communication with the MegaAPI service.
  • Error Messages:

    • "Unknown operation: logout" — indicates the operation parameter was not recognized; ensure the operation is set correctly to "Logout".
    • API errors returned from the MegaAPI service will be passed through; check the error message for details such as invalid credentials or session state.
  • Resolutions:

    • Verify that the API credentials are correct and have not expired.
    • Confirm that the WhatsApp instance is currently logged in before attempting logout.
    • Check network connectivity and firewall settings to allow outbound requests to the MegaAPI host.

Links and References

Discussion