Integrations
Connect WasenderApi with other platforms
Articles in this category
Integrating with n8n
Overview
n8n is an open-source workflow automation platform. This guide shows how to send and receive WhatsApp messages in your n8n workflows using WasenderApi.
Prerequisites
- Your WasenderApi base URL (e.g.
https://wasenderapi.com/api
) - A valid Bearer Token generated from the WasenderApi dashboard
- An active WhatsApp session ID
- An n8n instance (self-hosted or cloud)
Send a WhatsApp Text Message
- Add an HTTP Request node to your workflow.
- Set Method to
POST
. - Set URL to
{{BASE_URL}}/api/send-message
. - Configure Headers:
Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json
- Switch Body Content Type to
JSON
and paste:{ "to": "+15551234567", "text": "Hello from n8n via WasenderApi!" }
- Execute the node – a successful response returns JSON similar to:
{ "success": true, "message": "Message sent successfully." }
Bulk send: To send the same message to up to 50 recipients provide an array:
{ "to": ["+15551234567", "+15557654321"], "text": "Promo message" }
If you are on the free trial you can only include up to 3 recipients per request.
Send an Image
Replace the text
field with imageUrl
(and optionally text
):
{ "to": "+15551234567", "imageUrl": "https://example.com/path/image.jpg", "text": "Check this out" }
Receive Incoming Messages
Use an n8n Webhook node:
- Create a new Webhook node and copy its URL.
- In the WasenderApi dashboard, open your session → Webhooks and paste the URL.
- Select the events you want to receive (Message Upsert, Message Status Update, etc.).
- Activate both the Webhook node and the workflow – n8n will now receive updates in real-time.
Next Steps
- Use additional WasenderApi endpoints (documents, images, polls) by adjusting the JSON body.
- Combine nodes (e.g., MySQL → Function → HTTP Request) to build complex automations.
- Check the full WasenderApi documentation for rate limits, errors, and advanced features.
Getting your API Key
- Log in to your WasenderApi dashboard.
- Open WhatsApp Sessions in the sidebar.
- Create or select an existing session.
- Click Show API Key and copy the value.
Tip: Store it in an n8n Credential so you never paste it in clear-text again.
Sending other message types
The request validator allows only one media field per call. Examples:
Document
{ "to": "+15551234567", "documentUrl": "https://example.com/manual.pdf", "fileName": "User-Manual.pdf" }
Audio
{ "to": "+15551234567", "audioUrl": "https://example.com/podcast.mp3" }
Contact card
{ "to": "+15551234567", "contact": { "name": "Support", "phone": "+15559876543" } }
Location
{ "to": "+15551234567", "location": { "latitude": 37.7749, "longitude": -122.4194, "name": "Golden Gate Bridge", "address": "San Francisco, CA" } }
Error handling & Rate Limits
Common responses:
// 401 – invalid or missing key { "success": false, "message": "Invalid API key" } // 422 – validation failed (e.g., unknown field) { "success": false, "message": "Validation failed", "errors": { "text": ["Required when no media field is given"] } } // 429 – you hit the protection limit { "message": "You have account protection enabled. You can only send 1 message every 5 seconds.", "retry_after": 5 }
If you expect bursts of messages, disable Account Protection on the session or throttle calls in n8n.
Securing Webhooks
WasenderApi signs every outbound webhook with X-Webhook-Signature
. In n8n:
- Drag a Function node before the rest of your logic.
- Add code to compare
$headers["x-webhook-signature"]
with the secret you configured under Settings → Webhooks. - If the signatures don't match, throw an error to stop the flow.
Example Chatbot Flow (Echo Bot)
This minimal flow listens for every incoming WhatsApp text and echoes it back to the sender. You can expand it into menus, AI prompts, CRMs, etc.
- Webhook node – Receive WhatsApp message
- HTTP Method:
POST
- Path:
/whatsapp-in
(or any unique path) - Response Mode: On Received
Copy the Production URL and paste it in WasenderApi → Session → Webhooks. Select Message Upsert.
- HTTP Method:
- Set node – Prepare reply
- Add two new JSON fields:
to
←{{$json["data"]["from"]}}
text
←`You said: ${$json["data"]["text"]}`
- Add two new JSON fields:
- HTTP Request node – Send reply
- Method:
POST
- URL:
{{BASE_URL}}/api/send-message
- Authentication: Header Auth
- Header Name:
Authorization
- Header Value:
Bearer {{YOUR_API_KEY}}
- Body Content Type:
JSON
- Body:
{{$json}}
(pass through from the Set node)
- Method:
- Enable the workflow. Send a WhatsApp message to your number and watch the real-time execution for debugging.
Instead of Set you can use a Function node for advanced logic such as AI prompts, keyword routing or database look-ups.
Still Need Help?
Can't find what you're looking for? Our support team is here to help.