whapi icon

whapi

Use whapi channel services

Actions3

Overview

This node sends messages to a specified recipient via a messaging platform. It supports sending various types of messages including text, images, videos, audio, documents, and contact cards. The node can simulate typing delays and send ephemeral messages that auto-delete after a set time. This is useful for automating communication workflows such as customer support, notifications, or broadcasting updates to groups or individual contacts.

Practical examples:

  • Sending a text notification to a user when an event occurs.
  • Sharing an image or document with a group.
  • Sending a disappearing message that deletes itself after a few minutes.

Properties

Name Meaning
Authentication Method of authenticating the request; currently supports using an access token credential.
Recipient Phone number or Chat ID of the contact, group, or channel to which the message will be sent.
Message Type Type of message to send. Options: Audio, Contact, Document, Image, Text, Video.
Typing Time Number of seconds (0-60) to simulate typing before sending the message.
Ephemeral Duration in seconds (0-604800) after which the message will be deleted automatically. Requires disappearing messages enabled.
Body Text content of the message (only for text message type).
Media String String representing media content (URL, media ID, or base64 string) used for non-text messages.
Caption Caption text for media files (applicable for image, video, document message types).

Output

The node outputs JSON data representing the result of the send message operation. This typically includes confirmation details such as message ID, status, timestamps, or error information if the send failed.

If media is involved, the output may include metadata about the uploaded or referenced media.

Binary data output is not indicated by the source code or properties, so it is assumed the node only outputs JSON responses.

Dependencies

  • Requires an API key or access token credential for authentication with the messaging service.
  • Depends on an external messaging API endpoint to send messages.
  • The node internally calls a router function from bundled dependencies to handle the execution logic.

Troubleshooting

  • Invalid Recipient: Errors may occur if the recipient phone number or chat ID is incorrect or not accessible. Verify the recipient identifier format.
  • Unsupported Media Format: Sending media with unsupported formats or invalid media strings (URLs, IDs, base64) may cause failures.
  • Ephemeral Message Setting Disabled: If ephemeral time is set but disappearing messages are not enabled in the chat, the message may not delete as expected.
  • Authentication Failures: Ensure the provided access token or API key is valid and has necessary permissions.
  • Typing Time Limits: Typing simulation times outside 0-60 seconds may be rejected.

Common error messages will likely relate to invalid parameters, authentication errors, or API rate limits. Checking the exact API response in the node output helps diagnose issues.

Links and References

  • Refer to the messaging platform's official API documentation for message sending endpoints and supported message types.
  • n8n documentation on creating and configuring credentials for API authentication.
  • Guides on formatting media strings (URLs, base64 encoding) for message attachments.

Discussion