MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Overview

This node operation updates the presence status in a WhatsApp chat with a specified contact. It allows you to programmatically show presence indicators such as "typing...", "recording audio...", "online", or "last seen" statuses to the contact, mimicking natural human interaction cues. This is particularly useful for creating more engaging and realistic automated chatbots or workflows that interact with users on WhatsApp by signaling activity states during conversations.

Practical examples include:

  • Showing "typing..." when the bot is preparing a response.
  • Displaying "recording audio..." if the bot is simulating sending a voice message.
  • Indicating "online" status to signal availability.
  • Pausing typing status to indicate a pause in response generation.

Properties

Name Meaning
To (Contact) The WhatsApp contact number to update presence status for. Format: phone number without '@' (e.g., 556195562618).
Presence Option The presence status to show in the chat. Options:
- Composing... (typing...)
- Last Seen Today at...
- Online
- Pause Typing
- Recording Audio...
Information Informational notice explaining that this operation updates your presence status visible to the contact, enhancing natural conversation flows.

Output

The output JSON contains the result of the presence update request sent to the WhatsApp service. Typically, it will confirm whether the presence status was successfully updated for the specified contact. The exact structure depends on the underlying API response but generally includes success indicators or error messages.

This node does not output binary data.

Dependencies

  • Requires an active connection to the MegaAPI WhatsApp service.
  • Needs valid API credentials (an API key/token and host URL) configured in n8n credentials to authenticate requests.
  • The node uses HTTP requests to communicate with the MegaAPI backend.

Troubleshooting

  • Common issues:

    • Invalid contact format: Ensure the contact number is provided without the '@' symbol and follows the correct international format.
    • Authentication errors: Verify that the API token and host URL are correctly set in the credentials.
    • Network or API downtime: Check connectivity and MegaAPI service status.
  • Error messages:

    • "Unknown chat operation": Occurs if an unsupported operation is selected; ensure "Presence Update Chat" is chosen.
    • API errors returned from MegaAPI will be passed through; check the error message for details.
  • Resolution tips:

    • Double-check input parameters for correctness.
    • Confirm credentials validity and permissions.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during batch processing.

Links and References

Discussion