Connect your external agent
Esta página aún no está disponible en tu idioma.
An external agent is anything outside Wabery that stays online and writes customer replies: n8n, Make, Zapier, your app, or your own AI runtime.
It receives a webhook, decides what to say, and sends the reply through Wabery:
Wabery webhook → your logic or AI → POST /v1/messages
In onboarding, choose I already have a backend, then pick your tool.
Need Wabery to provide and host the chatbot instead? Use the hosted-agent guide.
What every setup needs
Section titled “What every setup needs”- Create a public HTTPS endpoint in your workflow tool and paste it into
Wabery. Saving it creates a signing secret, switches the project to external
routing, and sends a
message.receivedsetup event. - Confirm the endpoint returns a 2xx response for the setup event. It has
payload.test: trueand synthetic channel and conversation IDs, so acknowledge it without calling the Messages API. - Create the reply-ready
wab_live_project key in onboarding. Keep it secret. The same key works in the shared sandbox and on connected WhatsApp channels. - Join the shared WhatsApp sandbox and send a customer-style message.
- Reply by mapping
payload.channel_idandpayload.conversation_idfrom the incoming live event into this request:
POST https://api.wabery.com/v1/messagesAuthorization: Bearer wab_live_...Content-Type: application/json
{ "channel_id": "channel_...", "conversation_id": "conv_...", "text": "Your generated reply"}-
Start with a Webhook node. Set HTTP Method to
POSTand Respond toImmediately. -
Under Options, add Only Run If and use this expression:
{{ $json.body.payload.test !== true }}Wabery’s setup event still receives
200, but n8n does not run the reply workflow with its synthetic IDs. -
Publish the workflow and copy its Production URL, not the temporary Test URL. Paste it into Wabery and choose Save and test webhook. See n8n’s current Webhook node documentation.
-
Put your routing, data lookup, or AI nodes after the Webhook node.
-
Finish with an HTTP Request node:
- Method:
POST - URL:
https://api.wabery.com/v1/messages - Authentication:
Generic Credential Type - Generic Auth Type:
Bearer Auth - Bearer Token: paste the raw
wab_live_...key. Do not add quotes or typeBearer; n8n adds that prefix. - Send Body: on
- Body Content Type:
JSON - Specify Body:
Using Fields Below
- Method:
-
Add these JSON body fields. n8n puts the Wabery event under
body; explicit Webhook-node references keep working after an AI or logic node changes the current item:Name Value channel_id{{ $('Webhook').item.json.body.payload.channel_id }}conversation_id{{ $('Webhook').item.json.body.payload.conversation_id }}textMap your final reply, commonly {{ $json.output }}for an AI Agent node.If you rename the Webhook node, use its new name in both ID expressions.
-
Publish the workflow, then send a real message through the Wabery sandbox to prove the complete reply loop.
The finished shape is Webhook → your logic / AI → HTTP Request.
- Start a scenario with Webhooks → Custom webhook, add a webhook, and copy its generated URL. Make documents this as an instant trigger in its current webhook guide.
- Paste that URL into Wabery. Choose Run once in Make before sending the Wabery test so Make discovers the event fields.
- Put your routing, data lookup, or AI modules after the webhook.
- Finish with HTTP v4 → Make a request. Select
POST, usehttps://api.wabery.com/v1/messages, selectapplication/json, and map the two IDs and reply text into the JSON body. - Select API key authentication and create a keychain. The key is
Bearer <your Wabery key>including the prefix, placement is header, and parameter name isAuthorization. This follows Make’s current API key keychain and HTTP v4 documentation.
The finished shape is Custom webhook → your scenario → HTTP v4. Turn the scenario on after the sandbox test succeeds.
Zapier
Section titled “Zapier”- Start a Zap with Webhooks by Zapier and choose Catch Hook. Zapier recommends Catch Hook for parsed POST payloads and generates a unique URL. See the current Zapier webhook trigger guide.
- Paste the Catch Hook URL into Wabery, send the Wabery test, then choose Test trigger in Zapier so the payload fields become mappable.
- Add the actions that choose or generate the reply.
- Add Webhooks by Zapier → POST. Send JSON to
https://api.wabery.com/v1/messages, mappayload.channel_id,payload.conversation_id, and the reply text, and addAuthorization: Bearer <your Wabery key>. - Test the POST action, then publish the Zap before proving the loop in the Wabery sandbox.
The finished shape is Catch Hook → your Zap → POST action.
Your own API
Section titled “Your own API”Expose a public HTTPS POST route that returns a 2xx response quickly. Read the
raw request body before JSON parsing, verify X-Wabery-Signature with the
project signing secret, and ignore duplicate event IDs. Then run your reply
logic and call POST /v1/messages with a reply-ready project key.
Use the webhook reference for signature verification, retries, complete event fields, delivery ordering, and media handling. Use the API client guide for TypeScript, PHP, and Python examples.
The finished shape is POST webhook → your handler → Messages API.
Before connecting a client number
Section titled “Before connecting a client number”Do not switch to a real number until the onboarding checklist shows all six tasks complete. The final sandbox task proves both directions: Wabery delivered the inbound event, and your selected platform returned a reply through the Messages API. When it passes, connect the client’s number under Channels.