Skip to main content
With webhook routing, Wassist hands every inbound WhatsApp message to your endpoint and doesn’t run an agent. Your code decides what to say and replies with one API call. Use it to connect an agent you’ve already built (LangChain, the OpenAI Agents SDK, Vercel eve, or your own) or any backend logic. By the end of this page you’ll send “hi” to the sandbox number and your own server will reply “Hello, world! You said: hi”.
Use your personal organization while testing on the sandbox (switch in Settings → Organization), and create the API key and webhook there. Sandbox chats are filed under your personal organization, so routing set up in a team organization won’t receive your messages.

1. Get an API key

In the dashboard, go to Settings → Developers → API keys, click Create API key and copy it. Your server uses it to send replies.

2. Write the handler

The handler verifies the signature, then replies to every routed message.
server.mjs

3. Expose it over HTTPS

Wassist needs a public URL to deliver to. Locally, a tunnel is the quickest option:
Copy the https://…ngrok.app URL it prints. Any HTTPS host works too: Vercel, Cloudflare Workers, Railway, your own server.

4. Create the webhook

1

Add the webhook

Go to Settings → Developers → Webhooks and click Create webhook. Set the URL to your tunnel plus /webhook, e.g. https://abc123.ngrok.app/webhook.
2

Keep the routing event ticked

All events are ticked by default. Make sure Subscription message received stays on. That’s the event routed messages arrive as, and a webhook without it silently gets nothing.
3

Copy the signing secret

The secret is shown once, straight after you create the webhook.
Now start the server with both values:

5. Route the sandbox to your webhook

1

Open the sandbox number

Go to Numbers and click the number under Sandbox numbers.
2

Switch routing to your webhook

In Routing, set Mode to Webhook: forward to your endpoint, pick the webhook you just created, and click Save routing.
This only affects your own chat with the sandbox number. Sandbox routing has to be set from the dashboard. API keys belong to the organization rather than a person, so they have no chat to route and get a 400.

6. Say hi

From the phone you signed in with, send hi to the sandbox number:
Your code is now answering WhatsApp. Every delivery, including the request, your response and any retries, is listed under Settings → Developers → Webhooks → your webhook, where you can also replay it.

What your endpoint receives

message.body is the text (or the image caption, or the voice note transcription). Images and voice notes also arrive as URLs in media, and tapped buttons in buttons. Use conversationId for everything you send back.
Reply within 10 seconds and do slow work (like calling an LLM) after you’ve returned 200. Wassist retries on 5xx and timeouts, so use the X-Wassist-Delivery header to skip duplicates. See Webhooks for signing, retries and replay.

Make it an agent

Swap the hello world line for your own logic. A typical handler shows a typing indicator, calls your agent, then replies:
Replies can also carry images, buttons and CTAs. See Send message. WhatsApp only allows free-form replies within 24 hours of the customer’s last message. After that, send an approved template.

Using Vercel eve

If your agent is built with Vercel eve, you don’t need to write the handler at all. @wassist/eve is a drop-in channel that verifies webhooks, shows typing indicators and sends replies:
agent/channels/whatsapp.ts
It reads WASSIST_API_KEY and WASSIST_WEBHOOK_SECRET from the environment and listens on /eve/v1/wassist. Point your webhook there and follow step 5 above.

Going live

Connect your own WhatsApp number, then route it the same way: Numbers → your number → Routing → Webhook. On your own numbers you can also do it from code, and route individual conversations:
See Conversation routing for per-conversation overrides, lifecycle events and the 24-hour window events.

Next steps

Managed agent

Let Wassist run the agent instead.

Conversation routing

Mix agents and webhooks per number and per conversation.