Guide · 8 min read

How to Build a WhatsApp AI Chatbot

WhatsApp is where your customers already are. This guide walks through how to build a production-ready WhatsApp AI chatbot for your business — from connecting your number, to training it on your own data, to automating meeting booking and lead qualification.

Why a WhatsApp AI chatbot

Over 2 billion people use WhatsApp. A chatbot that lives there answers customer questions instantly, qualifies leads while you sleep, and books meetings without back-and-forth. Compared to a web chat widget, WhatsApp gives you push reach, voice notes, media, and a conversation thread that customers actually keep.

Step 1 — Choose your WhatsApp channel

There are two practical ways to connect a bot to WhatsApp: the official WhatsApp Business API (best for high volume and templated outbound), and a Green API style bridge over your own number (fastest to launch, no template approvals). MagicBot supports both — for most small and mid-size businesses, starting with Green API and your existing number gets you live the same day.

Step 2 — Connect WhatsApp in MagicBot

  1. Create a client in the MagicBot console and add a bot.
  2. Open the bot's Integrations tab and pick Green API.
  3. Paste your instance ID and API token, then save.
  4. MagicBot auto-registers the inbound webhook — no manual ngrok or webhook plumbing.
  5. Click Verify WhatsApp flow to confirm the bot can send and receive.

Step 3 — Train the bot on your business data

A generic chatbot is worse than no chatbot. In the Knowledge tab you can:

  • Paste in FAQs, pricing, policies, and product copy line by line.
  • Crawl your website — MagicBot reads every page and indexes it for the bot.
  • Upload PDFs, menus, brochures, or onboarding docs.

Then write a short system prompt describing the bot's persona, tone, and what it should refuse. The guardrails keep it on-topic, in your brand voice, and replying in whichever language the customer wrote in.

Step 4 — Automate meeting booking

Connect Google Calendar (one click in the Integrations tab). The bot can then check live availability, propose the next free slots in the visitor's timezone, and create the calendar event with the right subject and attendees — all inside the WhatsApp thread. No "I'll get back to you" delays.

Step 5 — Qualify leads automatically

Use the bot persona and "people of reference" settings to teach the bot what a qualified lead looks like — budget, timeline, role, use-case. The bot collects answers in natural conversation, writes them back to your CRM via the CRM integration, and pings a human in the inbox the moment a hot lead lands.

Step 6 — Voice, media, and human takeover

  • Incoming voice notes are auto-transcribed and answered in the same language.
  • Customers can send images and files; agents can reply with attachments too.
  • The moment an agent replies from the app or directly from the phone, the bot pauses for 3 hours so the human conversation isn't interrupted.
  • Working-hours rules decide whether to reply live or send an out-of-hours message.

Step 7 — Launch and iterate

Run a few real conversations through the Chat Test tab before flipping the bot on. Watch the WhatsApp inbox for the first week, tighten the system prompt and knowledge base where the bot guesses, and add new integrations (Stripe for payments, Calendly for self-serve booking, Slack for internal alerts) as you grow.

Build yours in an afternoon

MagicBot ships every piece of this stack — WhatsApp connection, knowledge base, calendar booking, lead qualification, multilingual replies, and human takeover — in one console.

Create your MagicBot account →