WhatsApp agents

Build AI agents that converse on WhatsApp Business — with the same brain as your voice, chat, and SMS agents.

WhatsApp agents handle two-way conversations on WhatsApp Business. They use the same LLM and tools as your other agents but speak the WhatsApp protocol (messages, media, templates) and respect WhatsApp's specific rules around the 24-hour customer service window.

Why WhatsApp

In many countries (Brazil, India, Mexico, Indonesia, much of Southeast Asia, Europe), WhatsApp is the primary messaging channel. If your customers prefer it over SMS or email, you should be there.

Prerequisites

WhatsApp requires more setup than SMS or chat:

  1. A Meta Business account — sign up at business.facebook.com.
  2. A WhatsApp Business API number — either:
    • A new number provisioned via your messaging provider (Twilio, Plivo, or Meta Cloud API), or
    • An existing landline / mobile number you migrate. Once migrated, that number can no longer be used in the regular WhatsApp app.
  3. A verified Meta Business profile — Meta requires business verification before scaled messaging is permitted.
  4. (For US senders) Brand registration with Meta.

This takes 1–2 weeks if you're starting from scratch. Plan accordingly.

Create a WhatsApp agent

Dashboard → Agents → New agent → WhatsApp.

Required fields:

  • Name — internal label.
  • System prompt — the personality and behavior. WhatsApp tone is conversational — somewhere between SMS and chat. Lists, line breaks, and basic formatting (bold via *text*, italics via _text_) work.
  • First message — what the agent says when a contact messages first.
  • LLM provider + model — see Models.

Optional:

  • Knowledge base
  • CRM integration
  • Custom tools

The 24-hour customer service window

WhatsApp imposes a strict rule that's different from SMS:

Once a customer messages you, you have 24 hours to reply freely with any content. After 24 hours of customer silence, you can only send pre-approved message templates until they reply again.

What this means in practice:

ScenarioWhat's allowed
Customer just messaged youReply with anything — text, images, buttons, lists
23h since customer's last messageStill free-form
25h since customer's last messageOnly approved templates
You message a brand-new contact (no prior conversation)Only approved templates

Nerva's whatsapp.ended webhook fires after ~23.5 hours of inactivity — giving you a 30-minute buffer to act before Meta closes the window.

Templates

Templates are pre-approved messages you can send outside the 24-hour window. Use cases:

  • Appointment remindersHi {{1}}, this is a reminder of your appointment on {{2}} at {{3}}.
  • Order confirmationsYour order #{{1}} has shipped. Track it here: {{2}}
  • Re-engagementHi {{1}} — we miss you! Use code {{2}} for 20% off your next order.

Templates are submitted to Meta for approval and typically reviewed within 24–48 hours. Approved templates work as part of your agent's flow.

Manage templates in Dashboard → Agents → your WhatsApp agent → Templates.

Rich messaging

WhatsApp supports more than plain text:

  • Images, videos, documents — the agent can send media when relevant.
  • Buttons — quick-reply buttons (up to 3) the user can tap.
  • List messages — a tap-to-pick menu for up to 10 options.
  • Location — the agent can send your location pin.
  • Contact card — share a contact's vCard.

The agent decides when to use these via tool calls. Define which rich messages it can send in the agent editor's Messages tab.

Session model

A session is a single thread between a customer's WhatsApp number and yours. It opens when the customer messages first and closes after ~23.5 hours of inactivity (just before Meta's 24h window closes).

If the customer messages again after the session closed, a new session starts and the 24-hour window opens again.

Webhooks

Subscribe to real-time events:

  • whatsapp.started — first inbound message of a new session
  • whatsapp.ended — ~23.5 hours after the last customer message
  • whatsapp.analyzed — after post-processing completes
  • whatsapp.failed — send/receive errors

See Webhook events.

Outbound to existing contacts

To send the first message to a customer who hasn't recently messaged you, send an approved template:

  1. The agent (or your backend, via API) initiates a template message.
  2. Meta delivers the template to the customer.
  3. If they reply, a 24-hour conversation window opens — the agent now replies freely.

For volume outbound template sends (e.g., 500 appointment reminders), use Campaigns configured for WhatsApp.

Pricing & Meta conversation fees

WhatsApp charges Meta per conversation, not per message:

  • Service conversation — customer initiates within 24 hours. Cheap or free.
  • Marketing conversation — you initiate with a marketing template. Costs more.
  • Utility conversation — you initiate with a transactional template (reminders, OTPs). Mid-price.
  • Authentication conversation — OTP-only templates. Lowest paid tier.

Conversation pricing varies by country. Check Meta's WhatsApp pricing page.

Nerva platform usage (LLM + infra) is billed separately — see Billing & plans.

Tips for SMB owners

  • Lead with service, then escalate. Welcome customers cordially; only push marketing templates to existing engaged contacts.
  • Templates take days to approve. Submit them as soon as you know what you'll send — don't wait for the campaign deadline.
  • Reply fast within the window. WhatsApp users expect near-real-time responses. Use fast LLMs (GPT-4o-mini, Claude Haiku).
  • Use Meta's quality rating. Meta tracks how customers react to your number (block, report). A low quality rating throttles your sends. Don't spam.
  • Don't use WhatsApp for surveys or cold marketing. Customers report unsolicited business contact aggressively. Stick to consented service conversations.

See also

On this page