WSAPI Message

Send and manage WhatsApp messages via WSAPI

Overview

This node enables sending WhatsApp messages through a WSAPI service, specifically supporting the "Send Image" operation for the Message resource. It allows users to send images to individual contacts or groups on WhatsApp by specifying either an image URL or Base64-encoded image data. Additional options include setting the MIME type of the image, adding an optional caption, and advanced message features such as mentions, replying to specific messages, marking the message as forwarded, and sending disappearing media (view once).

Common scenarios:

  • Sending promotional or informational images to customers or group chats.
  • Sharing product photos or event flyers directly via WhatsApp.
  • Automating image-based notifications with captions and references to other messages.

Practical example:
A marketing automation workflow sends a product image with a caption to a customer’s WhatsApp number, mentioning the customer and replying to their last inquiry message.


Properties

Name Meaning
Recipient WhatsApp ID of the recipient (phone number with @s.whatsapp.net for contacts, or group ID with @g.us for groups).
Image Source Source of the image to send. Options: URL (provide a direct link to the image), Base64 (provide Base64 encoded image data).
Image URL URL of the image to send (required if Image Source is URL).
Image Base64 Base64 encoded image data (required if Image Source is Base64).
MIME Type MIME type of the image. Options: image/jpeg, image/png, image/webp. Default is image/jpeg.
Image Caption Optional caption text to accompany the image.
Advanced Options Collection of additional settings:
- Mentions: Comma-separated list of WhatsApp IDs to mention in the message.
- Reply To Message ID: ID of the message this is replying to.
- Is Forwarded: Mark message as forwarded (boolean).
- View Once: Send as disappearing media (boolean).

Output

The node outputs a JSON object representing the response from the WSAPI after sending the image message. This typically includes details about the sent message such as message ID, status, timestamps, and any metadata returned by the API.

If the message is successfully sent, the output JSON confirms the delivery request. The node does not output binary data itself; it only handles sending image content via URL or Base64 encoding.


Dependencies

  • Requires connection to a WSAPI WhatsApp messaging service.
  • Needs an API key credential and instance identifier configured in n8n credentials for authentication.
  • The WSAPI base URL and API keys must be properly set up in the node credentials.
  • Internet access to fetch images if using URL source.

Troubleshooting

  • Invalid recipient ID: Ensure the recipient WhatsApp ID is correctly formatted with @s.whatsapp.net for contacts or @g.us for groups.
  • Image URL inaccessible: If using URL as image source, verify the URL is publicly accessible and points directly to an image file.
  • Incorrect Base64 data: When using Base64, ensure the string is properly encoded without extra characters or line breaks.
  • Unsupported MIME type: Use one of the supported MIME types (image/jpeg, image/png, image/webp) to avoid errors.
  • API authentication errors: Confirm that the API key and instance ID credentials are valid and have necessary permissions.
  • Advanced options misuse: Mentions should be valid WhatsApp IDs; replyTo message IDs must exist in the chat context.

If the node throws errors related to HTTP requests, check network connectivity and WSAPI service availability.


Links and References


Note: Internal credential names and exact API endpoint details are abstracted for security and clarity.

Discussion