Actions50
- Message Actions
- Contact Actions
- Account Actions
- Call Actions
- Chat Actions
- Group Actions
- Instance Actions
- Media Actions
- Session Actions
- User Actions
Overview
The node integrates with the WSAPI WhatsApp API to send various types of WhatsApp messages. Specifically, for the Message > Send Document operation, it allows sending a document file to a specified WhatsApp contact or group by providing a publicly accessible URL to the document.
This node is useful in scenarios where automated workflows need to share documents via WhatsApp, such as sending invoices, contracts, reports, or any PDF/office files directly to customers or team groups.
Example use cases:
- Automatically sending a PDF invoice to a customer after an order is placed.
- Sharing a contract document with a client upon signing.
- Distributing meeting notes or presentations to a project group.
Properties
| Name | Meaning |
|---|---|
| To | The WhatsApp ID of the recipient. For individual contacts, this is the phone number with country code (no plus sign) followed by @s.whatsapp.net (e.g., 1234567890@s.whatsapp.net). For groups, use the group ID followed by @g.us. This is required. |
| Media URL | The direct HTTP or HTTPS URL of the document file to send. Must be publicly accessible. Supported formats depend on WhatsApp but typically include PDFs, DOCX, XLSX, etc. |
| Caption | Optional text caption to accompany the document message. Supports emojis and formatting. |
| Advanced Options | Additional optional settings: - Mentions: Comma-separated list of phone numbers (without @) to mention in the message.- Reply To Message ID: ID of a message to reply to. - Is Forwarded: Boolean indicating if the message is forwarded. - View Once: Boolean to make media disappear after viewing (not applicable for documents). |
Output
The node outputs JSON data representing the response from the WSAPI WhatsApp API after sending the document message. This typically includes metadata about the sent message such as message ID, status, timestamps, and recipient information.
If the operation involves binary data (not typical for sending documents via URL), the node would handle it accordingly, but in this case, the document is sent via a URL, so no binary output is expected.
Dependencies
- Requires an active connection to the WSAPI WhatsApp API service.
- Needs an API key credential configured in n8n to authenticate requests.
- The provided media URL must be publicly accessible over HTTP or HTTPS.
- Proper permissions and WhatsApp Business API setup are assumed.
Troubleshooting
- Invalid "To" format: Ensure the recipient ID follows the correct format (
phone@s.whatsapp.netfor contacts,group@g.usfor groups) including country code without+. - Media URL inaccessible: The document URL must be publicly reachable. Check for typos, expired links, or access restrictions.
- Unsupported document format: Verify that the document format is supported by WhatsApp.
- API authentication errors: Confirm that the API key credential is valid and has necessary permissions.
- Message sending failures: Review error messages returned by the API for details like quota limits, blocked contacts, or invalid parameters.
- Reply To Message ID invalid: If replying to a message, ensure the referenced message ID exists and belongs to the same chat.