Send a WhatsApp template from n8n or Make
Ce contenu n’est pas encore disponible dans votre langue.
A workflow can start a SynapsAI campaign: the same engine, billing and delivery tracking as a campaign sent from the console, started from n8n or Make. Use it to send an approved WhatsApp template (the only message WhatsApp allows outside the 24-hour window) or a free-text message on WhatsApp, Messenger or Instagram to contacts who wrote to you in the last 24 hours.
Before you start
Section titled “Before you start”- The workflow API is part of the GROWTH, PRO and ENTERPRISE plans (see the overview).
- Sending campaigns over the API is off by default for every account. Ask support to turn it on for yours — until
then a send answers
403 CAMPAIGN_SEND_NOT_ALLOWED(“Campaign send via API is not enabled for this account — contact support”). Reading templates, campaigns and contacts always works. Sending from the console is not affected. The console’s API keys screen shows the same notice (“API campaign send not enabled — contact support”) while it is off. - Create an API key in the console with
campaigns:readandcampaigns:write(andcontacts:readto list contacts,hooks:writefor the trigger).campaigns:writeis off by default and asks you to confirm your identity when you mint the key. - You are responsible for your contacts’ consent to receive messages from you; SynapsAI does not check it.
- Add SynapsAI → Template → Get Many and pick the agent. Each item is an approved template with its
name,language,bodyandvariables. - For a session message, add SynapsAI → Contact → Get Many with the filter In Window (WhatsApp, Messenger or
Instagram). Each contact carries
windowExpiresAt. - Add SynapsAI → Campaign → Send. Choose the channel, the template (name and language) or the message, and the
recipients: a list of contact IDs, or
{contactId, variables}objects when each contact has its own values ({"contactId": "c1", "variables": {"1": "Ana"}}). Optional: campaign-wide variables, merge-field fallbacks and Schedule At. - To follow the result add SynapsAI Trigger with the events Campaign Message Delivered / Read / Failed and Campaign Completed, or read it later with Campaign → Get and Get Deliveries.
- Search templates lists the approved templates; the template picker of Send a WhatsApp template campaign offers the same list for the agent you chose.
- Search contacts takes In 24 h window on, for the session channels.
- Send a WhatsApp template campaign takes the agent, the template, the recipients (contact IDs) and optional variables. Send a session message campaign takes a channel (WhatsApp session, Messenger, Instagram) and the message.
- Get a campaign reads the counts. The triggers Campaign message failed and Campaign completed start a scenario when a message fails or the campaign ends.
What comes back
Section titled “What comes back”The send answers 202 at once; delivery is asynchronous.
{ "campaignId": "6720a1b2c3d4e5f607182930", "status": "SENDING", "recipients": 2, "skipped": [{ "contactId": "c_91", "reason": "OUT_OF_WINDOW" }], "creditsCharged": 1}skippedlists contacts that could not be reached —OUT_OF_WINDOW(a session channel and the 24 hours are over),NO_CHANNEL(no such channel on the contact) orUNKNOWN_CONTACT. They are not charged.- Credits are charged for the contacts that were sent: 1 credit per 2 recipients, like a console campaign. With too few
credits the call answers
402 INSUFFICIENT_CREDITSand creates nothing. - Up to 1,000 contacts per call (
422 TOO_MANY_RECIPIENTS, nothing is sent). - Messenger and Instagram report sent and failed; WhatsApp also reports delivered and read.
Retrying safely
Section titled “Retrying safely”Every send carries an Idempotency-Key. The n8n node derives its default from the workflow, node, agent, resolved
request and input item, so a manual retry with identical input returns the original campaign. Campaign keys do not
expire server-side. The default key changes at UTC midnight, so a recurring daily send can use identical input. For
multiple identical sends in the same UTC day, set an explicit Idempotency Key expression that changes for each
intended send. The Make module creates a key per execution and item. Repeating a key with a different body answers
409 IDEMPOTENCY_CONFLICT.
For AI Agent workflows, use SynapsAI Tool (read-only) and never provide a key with campaigns:write or
contacts:write scopes.
Events
Section titled “Events”| Event | Scope | When |
|---|---|---|
campaign.message.delivered | campaigns:read | WhatsApp delivered a message |
campaign.message.read | campaigns:read | the contact read it |
campaign.message.failed | campaigns:read | a message failed — error.source and error.code say why |
campaign.completed | campaigns:read | the campaign finished, with its counts |
They use the same signed envelope, retries and quarantine as every other subscription.
These events also fire for campaigns started from the console, whenever the account has a campaign.* subscription. campaign.completed carries the counts as of completion; delivered and read receipts keep arriving afterwards as their own events. Messenger and Instagram report only sent and failed — they send no delivered or read events.
The Make triggers carry Campaign message failed and Campaign completed; for delivered and read in Make, read the
counts with Get a campaign.
Troubleshooting
Section titled “Troubleshooting”| You see | It means |
|---|---|
403 SCOPE_MISSING | the key lacks campaigns:write (or campaigns:read) |
403 CAMPAIGN_SEND_NOT_ALLOWED | API sending is not enabled for the account — contact support |
400 IDEMPOTENCY_KEY_REQUIRED | a custom HTTP call without the Idempotency-Key header (the node and module add it) |
409 CAMPAIGN_NOT_CANCELLABLE | the campaign is no longer scheduled (it has started sending, or finished) — only a scheduled campaign can be cancelled |
429 | more than 60 calls a minute with the same key — wait a second and retry |
422 TEMPLATE_NOT_APPROVED | the template was paused or rejected after you listed it |
422 EMPTY_AUDIENCE | every contact was skipped |