Build a WhatsApp Lead-Capture Flow in 10 Minutes (With the Wabery API)
Wabery is the messaging API you build on top of WhatsApp, Instagram, and Messenger. Here's how to stand up your own lead-capture flow in about 10 minutes using a WhatsApp Flow, a webhook, and the CLI.
Wabery is not a done-for-you bot. It's the messaging API you build your own solution on top of WhatsApp, Instagram, and Messenger. This is the most important sentence in this article, so let's start here.
A packaged "AI agent" tool decides for you how conversations work, what gets collected, and where the data goes. You're stuck with their model. Wabery gives you the primitives instead: a unified channels API, native WhatsApp Flows (in-chat forms), signed event webhooks, a CLI, and an MCP server. You wire them together however your business actually works.
The payoff: you can build a real lead-capture flow yourself in about 10 minutes, not 10 days, because the hard parts (channel auth, message delivery, the 24-hour window, the in-chat form UI) are already handled. You write the logic.
Here's the step-by-step.
Step 1: Create Your Account and Connect a Channel (3 Minutes)
Go to app.wabery.com and create an account. Email, password, done. No credit card required.
Once you're in, connect a channel. For WhatsApp it's the same flow as setting up WhatsApp Web: open WhatsApp on your phone, go to Linked Devices, scan the QR code on your screen. If your customers also reach you on Instagram or Messenger, connect those from the same screen, they all surface through one API.
Grab an API key from the dashboard while you're here. Everything you build talks to the same unified endpoint, regardless of which channel a message came in on.
Time spent: about 3 minutes.
Step 2: Define a WhatsApp Flow to Collect Lead Data (3-5 Minutes)
This is the part you'd normally have to build from scratch: a structured, in-chat form. With Wabery it's a WhatsApp Flow you describe as JSON, and Wabery renders it natively inside the chat. No web links, no leaving WhatsApp.
A minimal flow that captures the fields you care about:
{
"name": "new_lead",
"screens": [
{
"id": "DETAILS",
"title": "Tell us what you need",
"fields": [
{ "type": "text", "name": "service", "label": "What are you looking for?" },
{ "type": "text", "name": "timeline", "label": "Rough timeline or budget?" },
{ "type": "phone", "name": "phone", "label": "Best number to reach you" }
]
}
]
}
Push it with the CLI:
wabery flows push new_lead.json
You decide which fields exist, what's required, and how many screens. This is your form, not a fixed template.
Time spent: 3-5 minutes.
Step 3: Trigger the Flow and Reply (2 Minutes)
Now wire up the logic: when an inbound message arrives, send the flow. You write this; Wabery just delivers it.
import { Wabery } from "@wabery/sdk";
const wabery = new Wabery({ apiKey: process.env.WABERY_API_KEY });
wabery.on("message.received", async (event) => {
await wabery.messages.send({
channel: event.channel,
to: event.from,
flow: "new_lead",
body: "Happy to help! A couple of quick questions:",
});
});
That's the whole agent loop. If you want natural-language answers instead of a form, you own that too: call your LLM of choice with the message text, then reply through the same messages.send. Wabery hands you the message and the channel; the reasoning is yours to define.
Time spent: about 2 minutes.
Step 4: Receive the Captured Data on a Webhook (2 Minutes)
When the lead completes the flow, Wabery delivers the answers to your webhook as a signed event. This is structured data landing in your stack, not a chat log you have to parse.
app.post("/webhooks/wabery", verifySignature, (req, res) => {
const event = req.body;
if (event.type === "flow.completed") {
const { service, timeline, phone } = event.data;
// your logic: write to your DB, push to your CRM, score it, alert your team
saveLead({ service, timeline, phone, channel: event.channel });
}
res.sendStatus(200);
});
Everything you'd want a "lead qualification product" to do, scoring, routing, alerting, you build right here, in code you control, against the systems you already use. Want hot-lead alerts? Add a Slack call in this handler. Want a score? Run your own logic on the fields. Wabery's job is to get you clean, signed data, fast.
Time spent: 2 minutes.
What You Get For Free By Building On The API
Here's why this is 10 minutes and not 10 days. The infrastructure you'd otherwise have to build yourself is already done.
One API Across Three Channels
The same message.received event and the same messages.send call work for WhatsApp, Instagram DMs, and Messenger. You write your logic once.
The 24-Hour Window, Handled
WhatsApp has a 24-hour messaging window and template rules. Wabery handles the mechanics so your code just sends messages; you don't manage window state by hand.
Native In-Chat Forms
WhatsApp Flows render inside the conversation. You define the schema, Wabery renders and validates it, and you receive the structured result. No web form, no redirect, no drop-off.
Signed, Reliable Webhooks
Every event is signed so you can verify it came from Wabery. Build your reminders, follow-ups, and CRM sync on top of events you can trust.
MCP Server and CLI
Prototype from your terminal with the CLI, or let an AI coding agent build against Wabery through the MCP server. The primitives are scriptable end to end.
Building More On Top
The 10-minute flow above is just the start. Because these are primitives, you compose them into whatever you need:
- After-hours capture: Your webhook handler checks the time and queues a follow-up; the lead still gets a useful reply at 10 PM because your code sent one.
- Multi-service requests: Parse the inbound text yourself (or with an LLM), send the right flow, branch on the answers.
- Returning leads: Look up the contact in your own DB on
message.receivedand personalize the reply. - Reminders: On
flow.completed, schedule a template message through the API ahead of an appointment.
None of this is locked behind a vendor's feature roadmap. It's your logic on Wabery's plumbing.
The "But What About..." Questions
"Does this replace my booking software?"
No, and you wouldn't want it to. Build your flow to drop a booking link, or call your scheduler's API from your webhook handler, whatever you already use (Acuity, Calendly, Fresha, Booksy, Boulevard, Vagaro, Google Calendar). Wabery owns the messaging layer; your booking tool owns the calendar.
"Do I have to write code?"
For the full build, yes, that's the point: you control the logic. But the CLI and dashboard let you stand up flows and test them without writing a backend first. Start simple, add code as you need it.
"What about WhatsApp's messaging rules?"
The 24-hour window and template messaging are handled by the API. You send; Wabery deals with the constraints.
"Can a human jump into a conversation?"
Yes. The unified inbox shows everything in real time. Your code handles the routine; a teammate can take over any thread.
"What does it cost?"
The free plan gives you monthly credits so you can build and test against real inbound traffic. The Pro plan ($29/month) raises your volume for production use. Start free, ship something small, scale when it's pulling its weight.
Before and After
Before: You evaluate five packaged "WhatsApp AI" tools, none of them do exactly what your business needs, and you bend your process to fit theirs.
After: You define one WhatsApp Flow, one webhook handler, and the behavior is exactly what you wanted, because you wrote it.
Before: Lead data lands as messy chat logs you scrape later.
After: Structured fields arrive on a signed webhook the moment a lead finishes the flow.
Before: Adding Instagram means a second integration project.
After: Same API, same events, one more connected channel.
10 Minutes. That's It.
Account, channel connection, a WhatsApp Flow, a webhook handler, live. About 10 minutes to a working lead-capture flow you built and control.
Not because someone packaged it for you, but because the infrastructure underneath, channel auth, delivery, the 24-hour window, in-chat forms, signed events, is already solved. You bring the logic. Wabery brings the plumbing.
Your WhatsApp number is already getting messages. The question is whether you build the system that turns them into structured leads, or keep shopping for a tool that almost fits.
Questions or feedback? Reach out anytime