← Back to Blog
ai-agents whatsapp-cloud-api official-api coexistence guide

WhatsApp AI Agent on the Official Cloud API

Short version: a WhatsApp AI agent is your own model or workflow answering customers on a WhatsApp number you control. The safe way to run one is Meta’s official WhatsApp Cloud API. Pipes Bot (PipesBot) is a managed connector on top of that API: it delivers every message to your code and sends your replies back. You keep the model, the host and the logic.

What a WhatsApp AI agent is (and is not)

A WhatsApp AI agent is your own model or workflow that receives a customer’s WhatsApp message and replies on the same thread. It answers support questions, takes orders, books appointments or hands the chat to a person, using whatever LLM and tools you choose.

It is not Meta AI, not Grok, and not a “free AI WhatsApp number.” Those are consumer chat products you talk to. It is also not Meta Business Agent, Meta’s native agent that you configure in the WhatsApp Business dashboard and that Meta runs for you. Meta Business Agent is an official path; its features are limited to what Meta offers natively. This page is about the other official path: a business or product agent on a number you control, connected through Meta’s official Cloud API.

WhatsApp AI agent use cases

Common patterns include a customer support bot, appointment booking, a WhatsApp CRM with lead follow-up, and e-commerce updates such as order confirmations and shipping messages. The use cases page covers these and other setups — including n8n, Make, or Zapier workflows, and an AI assistant on a number you control — all on Meta’s official Cloud API.

Why the official Cloud API is the path

Unofficial clients (Baileys, WAHA, whatsapp-web.js, Venom, and Evolution API in its Baileys mode) emulate WhatsApp Web. WhatsApp’s Terms of Service prohibit “the use of unauthorized or modified clients,” so running an agent on them puts the number at risk. Detection is cumulative, and a ban can take the number out of service. The details are in Baileys WhatsApp: Ban Risk vs Cloud API, and the wrappers are compared in Evolution API WhatsApp vs WAHA vs Baileys.

The official path uses the Cloud API: a registered business number, official webhooks, and stateless HTTP instead of a linked-device session. Every message routes through Meta’s official WhatsApp Cloud API. There’s no unofficial client for WhatsApp to detect and ban.

How the architecture works

WhatsApp → Meta’s Cloud API → PipesBot → your code.

Pipes Bot (PipesBot) is a managed connector. It POSTs every inbound message to your HTTPS webhook as Meta’s payload in a small signed envelope, or delivers the same events over a WebSocket that your process opens outbound. You reply through the REST API:

  • BYON Apps (App key ak_): POST https://api.pipes.bot/v1/messages/app/send for text and media, and POST https://api.pipes.bot/v1/messages/passthrough for templates and interactive messages.
  • Pool numbers (account key pk_): POST https://api.pipes.bot/v1/messages/send.

You choose the model, the host and the logic. PipesBot does not run the agent; it moves the messages between WhatsApp and your code.

Two ways to receive messages

  • Webhook: PipesBot POSTs to a public HTTPS URL. Best for serverless functions, n8n, Make, Zapier, or any HTTP endpoint. Localhost and private IPs are blocked. If your endpoint is down, PipesBot makes 3 attempts (0 s, 2 s, 8 s, with a 10 s timeout each). On App webhooks, failed deliveries are then kept for 7 days for manual retry from the dashboard.
  • WebSocket: your process connects out to PipesBot, so you need no public URL. Best for real-time agents, including the OpenClaw plugin. If you’re offline, messages are queued and delivered when you reconnect: on pool numbers, up to 100 messages per sender for 24 hours.

On BYON numbers, both can run in parallel, and you can switch methods in the dashboard. The docs compare the two in detail.

Pool numbers and your own number

  • Pool (sandbox): activate a PipesBot number and chat with it from your own WhatsApp. Receiving is unlimited. Sends are capped at 5 per UTC day per pool number, on every plan. Good for trying the product and for light personal use.
  • BYON (Bring Your Own Number): on Pro and Pro+, connect your WhatsApp Business number, or your customers’ numbers, through Meta’s Embedded Signup, at +$5 per number per month. PipesBot adds no markup per message; Meta bills API messages to the business that owns the number. There is no limit on numbers per App.

Keep the WhatsApp Business app

If the number is already on the WhatsApp Business app, PipesBot connects it with Coexistence: the app keeps working on the phone, chats stay there, and the agent uses the same number through the API. A few limits apply:

  • Throughput is fixed at 20 messages per second.
  • Someone must open the app at least about every 14 days, or Meta disconnects Coexistence.
  • Messages sent from the app stay free.

With API v2 and the opt-in Forward messages sent from the phone setting, replies typed on the phone reach your App as message_echoes (field: smb_message_echoes). Store them, and never reply to an echo: it is your own team talking, and it does not open the 24-hour window. See WhatsApp Coexistence: message_echoes Explained and the Coexistence docs.

The 24-hour window

Free-form replies work only inside the customer service window: the customer must have messaged you in the last 24 hours. Only a customer’s inbound message opens that window; echoes and imported history do not. Outside the window, send a Meta-approved template.

PipesBot does not expose a window-state endpoint, so compute it from the last customer inbound you stored. On pool numbers, an out-of-window send returns SERVICE_WINDOW_EXPIRED. On BYON, Meta may reject the send with error 131047.

Your agent must keep its own memory

New Apps start on API v2, and API v2 stores no conversations. There is no server-side history or message-list API on PipesBot. Persist inbound messages, your outbound sends, echoes and delivery statuses in your own store, keyed the way your agent looks up a customer.

Media is downloaded for you and kept for 48 hours, so copy anything you need to keep. PipesBot keeps only what delivery needs, and your conversations stay yours (see the privacy policy).

This is also why an MCP layer, if you want one, lives in your app. The mini-crm example already exposes contacts and drafts to Claude over MCP, from its own database.

Production details to get right

  • Verify signatures. On API v2, webhooks are signed with Standard Webhooks headers: webhook-id, webhook-timestamp and webhook-signature.
  • Dedupe on the delivery ID. Use webhook-id or the envelope id, not the wamid alone: a message, its statuses and its echo share a wamid.
  • Ack fast. Return 2xx quickly and run model inference in the background, so a slow LLM call never turns into retries.

The full implementation is in WhatsApp Cloud API webhooks for AI agents. If Meta accepts a send (200) but the message never arrives, use Number Diagnostics: Meta returned 200 but the message never arrived.

Open-source starting points

You don’t need to start from a blank file:

For the bigger picture of the platform underneath, see WhatsApp Cloud API for AI Agents.

What it costs

PipesBot Starter is $4/mo, with 1 pool number and 5 sends per day. Receiving is unlimited on every plan. BYON is +$5 per number per month on Pro and Pro+. All plans are in the pricing section on the PipesBot home page.

Meta’s side of the bill is separate. Read WhatsApp Service Messages in October 2026 and WhatsApp Cloud API vs Meta Business Agent for how Meta prices API messages.

Frequently Asked Questions

What is a WhatsApp AI agent?

Your own model or automation that reads WhatsApp messages and replies on the same number, through Meta’s official Cloud API. It is not Meta AI, not Grok, and not Meta’s native Meta Business Agent.

Is a WhatsApp AI agent allowed under WhatsApp’s terms?

Bots for business operations (support, orders, FAQs) are allowed on the official WhatsApp Cloud API and Business Platform. Unofficial clients are not. Use the official API, or a managed connector that uses it.

Do I have to become a Meta Tech Provider?

Meta asks for it when you onboard other businesses’ numbers yourself. With a managed bridge such as PipesBot, you don’t: PipesBot is already a registered Tech Provider and gives you webhooks, WebSocket and Embedded Signup.

Can I keep using the WhatsApp Business app on my phone?

Yes, with Coexistence on a BYON number: the app stays on the phone, and the agent uses the same number through the API. Throughput is 20 messages per second, and the app needs to be opened about every 14 days. Turn on message echoes (API v2) so the agent sees phone replies.

Do I need to expose my agent to the internet?

Not with WebSocket or the OpenClaw plugin: your process connects outbound. Webhook mode does need a public HTTPS URL, and localhost and private IPs are blocked.

Can I use my own business WhatsApp number?

Yes, on Pro and Pro+, through BYON, at +$5 per number per month. Numbers already on the WhatsApp Business app keep working there.

What happens if my agent goes offline?

Over WebSocket, PipesBot queues messages and delivers them when you reconnect; on pool numbers that’s up to 100 messages per sender for 24 hours, and you also get a WhatsApp notification. On webhooks, PipesBot tries 3 times, and on App webhooks the payload is kept for manual retry.

How much does a WhatsApp AI agent cost?

PipesBot starts at $4/mo for Starter (1 pool number, 5 sends per day). Pro is $12/mo and Pro+ is $34/mo. BYON is +$5 per number per month on Pro and Pro+. Meta bills Cloud API messages separately; see the service messages and TCO posts linked above.

Is WhatsApp automation free?

WhatsApp automation is not a single free product. On the official Cloud API, Meta bills messages separately: since 1 October 2026, each business phone number gets 1,000 free service messages per month, and further service messages are charged per delivery. Details are in WhatsApp Service Messages in October 2026. PipesBot plans are Starter $4/mo, Pro $12/mo, and Pro+ $34/mo. BYON is +$5 per number per month on Pro and Pro+. Meta Business Agent, Meta’s native agent, is billed per token; see the TCO comparison.

Can you do AI on WhatsApp?

Yes, on official channels. You can run your own model or workflow on a business number through Meta’s official WhatsApp Cloud API, or use Meta’s native Meta Business Agent. Bots for business operations (support, orders, FAQs) are allowed on the official Cloud API and Business Platform. Unofficial WhatsApp Web clients are not.

Can I build this with n8n, Make, Zapier, or OpenClaw?

Yes. Webhook mode works with any HTTP endpoint. For OpenClaw, install @pipes.bot/pipes-bot-channel. You can also start from the open-source examples (AI Handoff, mini-crm, Conversation Analyzer).

Why not use Baileys, Evolution API, or WAHA?

Baileys and WAHA are unofficial WhatsApp Web clients, and so is Evolution API when it runs on Baileys. The protocol-level risk is the same for all of them, and public HTTP endpoints can increase exposure. For a number that matters, use the official Cloud API. See the Baileys and comparison posts linked above.

Get started

Your AI agent deserves a real WhatsApp connection. Create a PipesBot account and connect a pool number in minutes, or bring your own WhatsApp Business number on Pro and Pro+.