How to Create a WhatsApp AI Agent: Hosted Setup or Custom Integration
Create a Wabery hosted agent for your business, or choose a custom integration. Add your information, test the conversation, and connect your number when ready.
For a shorter overview, see the WhatsApp AI agent page. You can create an agent for your own business or manage it for a client.
Wabery can host your WhatsApp agent for you. Add your business information, choose whether it should answer questions, collect leads, or help with bookings, and test it before customers use it. Your team can take over from the inbox.
Start with the hosted setup below. The custom integration sections are optional and are intended for developers who want to run their own service.
Full disclosure: this is written by the team behind Wabery, and the steps use it. The concepts transfer to any official provider. The parts we do not have are marked as such.
What You Are Actually Building
A WhatsApp AI agent is four moving pieces:
- A WhatsApp Business number on Meta’s official Cloud API, with a WhatsApp Business Account (WABA) behind it.
- A receive path. Inbound messages arrive as webhooks.
- A decision layer. Something reads the message, holds conversation state, calls tools, and writes a reply.
- A send path. The reply goes back out inside WhatsApp’s rules.
Every tutorial covers 1 and 4. The interesting decision is 3, and the expensive mistake is ignoring the rules attached to 4.
Step 1: Skip the Meta Setup for Now
The single most common way a WhatsApp agent project dies is spending week one in Meta Business Manager: business verification, display-name review, a test number that only messages five hand-added recipients. You have not written a line of agent logic and you already need someone’s tax documents.
Do not start there. Start on a sandbox.
On Wabery, every project begins on a shared WhatsApp sandbox number. Create a project, copy a join code that looks like wab-ABC123, text it from your own phone, then send a normal message. That message creates a real conversation in the WhatsApp app with no Meta account or business number. Sandbox delivery is free through September 30, 2026; from October 1 it uses wallet credit at Meta’s published destination-market service rate, without markup. New accounts get $1 of AI credit without a card. The first wallet top-up of $10 or more adds $2 bonus credit.
You → sandbox number: wab-ABC123You → sandbox number: hi, do you take walk-ins on saturday?Agent → you: We do, until 4pm. Would you like to see available appointments?That thread is what you show a stakeholder or a client. A 200 response in Postman is not.
You move to a real number later, once the agent is worth putting on one. Sandbox docs.
Step 2: Decide Who Writes the Replies
This is the fork in the road. Wabery asks it during onboarding, in one question, because it changes everything downstream.
Path A: Hosted agent
Wabery runs the agent. You never deploy anything.
Choose this when the agent’s job is describable in a paragraph: answer questions, collect a few fields, escalate when it should not guess. Which is most of them, honestly.
Path B: Your own backend
You already have the brains. n8n, Make, Zapier, a Python service, a LangGraph app, an OpenAI or Anthropic loop you have tuned for months. Wabery is the WhatsApp connection under it.
Choose this when the agent needs your data, your models, your prompt versioning, or your compliance boundary.
Path C: Both
Nothing stops you starting hosted to prove the shape of the conversation, then switching to your backend once the logic outgrows a description. It is a project setting, not a migration to a different vendor.
Getting started: choose who writes the replies.
Step 3A: Build the Hosted Agent
You can create and run this agent yourself as a business owner. The hosted setup can answer questions, save confirmed enquiries in Leads, and help customers book through Reservations. Your team can take over in the inbox. You do not need the external-backend steps below unless you choose that path.
Say what it should do
Wabery asks for the job, not a pile of settings. Be concrete:
Answer questions for a dental clinic, collect the treatment and preferred date, and hand off emergencies or anything about billing.
“Be a helpful assistant” is not a spec. Say what success looks like and, more importantly, say when a human should take over. That second half is the one people forget and then regret.
Give it facts
Import a website, paste client details, or upload text, Markdown or CSV. Good knowledge is the boring stuff:
- services and prices
- opening hours and locations
- booking, refund and cancellation rules
- the answers your team retypes every day
- what the agent must never guess
That last line is the one that saves you. An agent that says “I don’t have that, let me get someone” is worth ten that improvise a price.
Test the Draft on your phone
Wabery builds a Draft and prepares its sandbox tools. Join the sandbox, then send real customer-style questions. Include the awkward ones. Ask something deliberately missing from the knowledge. Try to trigger a handoff. Check that it stays short, because WhatsApp is a chat and nobody reads four paragraphs on a phone.
Step 3B: Connect Your Own Backend
The shape is three arrows:
WhatsApp → signed Wabery webhook → your logic or AI → POST /v1/messages
- Create the reply-ready project key during onboarding. Keep it secret.
- Stand up a public HTTPS endpoint and paste it into Wabery. Wabery generates a signing secret when it saves the endpoint. Verify signatures. Yes, actually verify them.
- Send Wabery’s
message.receivedtest event and confirm your endpoint returns 2xx. - Turn on Use my API so inbound messages route to you instead of a hosted agent.
- Join the sandbox and send a customer-style message.
- Reply by mapping
payload.channel_idandpayload.conversation_idfrom the event into the send call:
POST https://api.wabery.com/v1/messagesAuthorization: Bearer wab_live_...Content-Type: application/json
{ "channel_id": "channel_...", "conversation_id": "conv_...", "text": "Your generated reply"}In n8n the finished shape is Webhook → your logic / AI → HTTP Request. In Make it is Custom webhook → your modules → HTTP v4. In your own service it is a route handler and an outbound fetch.
Your system has to stay online to answer. That is the deal with Path B, and it is the honest reason Path A exists.
Step 4: Add the Parts an LLM Should Not Improvise
A pure LLM loop is a bad way to collect a phone number and a worse way to take a booking. Mix deterministic pieces into the conversation:
Automations. A trigger plus a chain of actions, running in Wabery with no server. Triggers are Welcome (first-ever message), Keyword, and Any message, evaluated first-match-wins. Actions include Send Reply with quick-reply buttons, Send Flow, Run Function, Delay, Wait for Reply, Condition, and Pause Replies. Use these for anything you want to happen the same way every single time. Automations.
WhatsApp Flows. Native in-chat forms. You define the fields, the customer fills a real form inside WhatsApp, and you receive validated JSON. Static flows render on-device; DATA_EXCHANGE flows fetch options from your HTTPS endpoint at runtime, which is how you do cascading dropdowns or per-user prefill. Publish one dynamic flow, not one flow per user. Flows.
Hosted functions. Project-scoped TypeScript that Wabery runs, for the one step that needs live data: a quote, a stock lookup, a routing decision, an agent tool. Deployments stay inactive until you review and activate them. Hosted functions.
Handoff. One conversation, two states. With handoff on, automations, external webhooks and public API outbound sends are all paused for that thread while a teammate replies in the inbox. Nothing else in the inbox is affected. Every agent needs this and the ones that skip it generate the angriest support tickets. Handoff.
Rule of thumb: automations first, functions only when a step genuinely needs code, the model for the parts that are actually conversation.
Step 5: Learn the Three WhatsApp Rules Before You Go Live
This is the part that is specific to WhatsApp and catches every team once.
The 24-hour window. After a customer messages you, you can reply freely for 24 hours. Outside that window you can only send an approved template, and it costs money. Design the conversation to finish inside the window rather than assuming you can follow up whenever.
Templates need approval. Any business-initiated message is a template Meta reviews. Write and submit them early. Discovering this on launch day is a bad day.
Opt-in is not optional. People must have agreed to hear from you. Blasting a purchased list is how numbers get quality-rated into uselessness, and quality ratings are hard to climb back out of.
Meta bills your dedicated WABA directly for messages and templates at its published rates. Wabery does not mark that up. For the shared sandbox, Wabery pays Meta and deducts the same published service rate from wallet credit after the October 1 cutoff. WhatsApp pricing notes.
Step 6: Build It With a Coding Agent, If You Want
Wabery has a hosted MCP server, so Claude, ChatGPT, Cursor, Codex or Claude Code can configure the project directly instead of you clicking through it.
claude mcp add --transport http wabery https://mcp.wabery.comThen hand it the goal:
Use the Wabery MCP server to help me complete the sandbox quickstart.List my projects, find the sandbox join code and number, tell me what tosend from my phone, then check whether the configured agent replied.Ask before making changes and do not publish anything to Live.There is also a CLI (npm i -g @wabery/cli), a REST API, a TypeScript SDK, and an OpenAPI 3.1 spec. Same project, four doors.
One distinction worth keeping straight: an MCP-connected coding agent is a build tool. It is not the always-on thing answering customers unless you separately deployed a backend for that job.
Step 7: Go Live Without Breaking Anything
Three names, and they are not decoration:
| Name | What it means |
|---|---|
| Draft | The version you are editing. Customers never see unfinished changes. |
| Sandbox | The shared WhatsApp number where you test the Draft from your own phone. |
| Live | The version answering customers on connected channels. |
Publishing is a deliberate step that replaces Live with the reviewed Draft. A coding agent or MCP client publishes Live only after it shows you the changes and you confirm. You can also review and publish from the website.
That constraint exists for a specific 2026 failure mode. Once you have wired a coding agent into your infrastructure, and you should, the risk stops being “someone deployed a typo” and becomes “the agent confidently rewrote the system prompt at 2am.” If the number belongs to a client’s business, an approval step is the cheapest insurance available.
Then connect the real number under Channels. If you are moving a number from another provider, read Connect WhatsApp first, and do not delete or deregister the old number before you start. Connecting a number and publishing the agent are separate actions: a connected number does not push an unfinished Draft live.
What This Costs
- Wabery: free tier is one production connection and 1,000 messages a month, no card. Pro is $15 a month for one production connection and 50K shared messages, then $5 and $3 for each additional connection. Hosted agent model usage is billed from wallet credit at published model rates plus a disclosed margin. Bring your own backend and you pay us nothing for model usage.
- Meta: dedicated WABAs are billed directly at Meta’s rates. Shared-sandbox delivery is free through September 30; from October 1 the published service rate is deducted from wallet credit without markup.
- Live-project capacity starts when the project is real. It flips to Live automatically the first time a non-sandbox channel connects. Drafts use no Live-project capacity; sandbox delivery uses wallet credit after the cutoff.
The Build, Compressed
- Create a project. Do not open Meta Business Manager yet.
- Choose hosted agent or your own backend.
- Describe the job, or wire the webhook and send API.
- Text the join code from your phone and have a real conversation with it.
- Add automations, Flows, functions and handoff for the parts that must not be improvised.
- Learn the 24-hour window, templates and opt-in before launch, not after.
- Review the Draft, publish Live yourself, then connect the real number.
An afternoon to a working sandbox thread. The Meta paperwork happens in parallel, once you already know the agent is good.
Frequently Asked Questions
Do I need a WhatsApp Business number to start building?
No. Every project starts on a shared WhatsApp sandbox number joined with a code like wab-ABC123, so you can test from your own phone without Meta Business Manager or business verification. Sandbox delivery is free through September 30, 2026; from October 1 it uses wallet credit. New accounts get $1 of AI credit without a card. The first wallet top-up of $10 or more adds $2 bonus credit.
Should the AI run on Wabery or on my own backend?
Use a Wabery-hosted agent when the job is describable in a paragraph and you do not want to operate a service. Use your own backend when the agent needs your data, your models, your prompt versioning, or your compliance boundary: Wabery sends a signed webhook and your system replies through POST /v1/messages. It is a project setting, so you can start hosted and switch later.
Can Claude or ChatGPT build the WhatsApp agent for me?
They can configure the project through Wabery's hosted MCP server at https://mcp.wabery.com, including creating automations, functions and channels. They cannot publish a hosted agent to Live: that stays a human action on the website, which is the point. An MCP-connected coding agent is a build tool, not the always-on system answering customers.
What are the WhatsApp rules that break new agents?
Three. You can only reply freely for 24 hours after a customer messages you, and outside that window you need an approved template. Business-initiated templates require Meta approval, so submit them early. And recipients must have opted in, because blasting a purchased list destroys your number's quality rating.
What does a WhatsApp AI agent cost to run?
The platform is free for one production connection and 1,000 messages a month, then $15 a month for one production connection and 50K shared messages, with extra connections from $5 a month. Meta bills dedicated WABAs directly with no Wabery markup. Shared-sandbox delivery is free through September 30, 2026; from October 1 Wabery deducts the published service rate from wallet credit. Hosted-agent model usage is billed separately; bring your own backend and you pay nothing to us for model usage.
Comparing platforms before you build? The Zernio alternative page covers the developer-API lane, and the Kapso alternative page covers adding WhatsApp inside a product you own.
Questions or feedback? Reach out anytime
Continue Reading
Twilio WhatsApp Sandbox + OpenAI: The Agency Last Mile
Compare a Twilio sandbox with Wabery’s hosted WhatsApp agent. Test customer questions, leads, and bookings before connecting a business number.
Zernio vs Wabery: A Broad Social API or a WhatsApp Business Agent?
Compare Zernio's broad social API with Wabery's hosted WhatsApp agent, leads, reservations, and team inbox for owners and client teams.
Kapso vs Wabery: Which WhatsApp Setup Fits Your Business?
Compare Kapso and Wabery for WhatsApp: Wabery combines a hosted agent with leads, reservations, and a team inbox you can set up yourself.