Guide · 14 minute read

How to set up an SMS or WhatsApp agent for your business

Twilio, WhatsApp Business API, compliance, threading, and real costs. The guide someone writes after running messaging agents for a year.

Benjam Indrenius

Benjam Indrenius

Published 2026-04-26

The short answer

Pick the channel your customers already use, not the one with the best engagement stats. US and Canada: SMS. Everyone can receive it. Europe, Latin America, Asia: WhatsApp. Then design around that channel's billing model, compliance rules, and failure modes. The cost difference between the two can be 10x depending on geography and conversation depth.

SMS vs WhatsApp: the real differences

SMSWhatsApp
ReachEvery mobile phone. Universal in US/Canada.90% of UK adults (Ofcom, 2025). 75% in Mexico. 500M+ in India. Weaker in US.
Cost modelPer segment, both directions. Gets expensive with depth.Per template outside window. Service replies in 24h window: free.
5-message convo (US)~$0.04~$0.025 (service window)
5-message convo (UK)~$0.18~$0.025 (service window)
Compliance10DLC registration (US), TCPA, CASL, carrier filtering.Template approval, quality ratings, messaging limits, Meta enforcement.
Best forNotifications, alerts, simple replies. North America.Conversations, support, lead handling. Europe, LatAm, Asia.

SMS gets more expensive the longer the conversation gets. WhatsApp often gets cheaper because only the opening template costs money. In Europe, WhatsApp service conversations are 7-14x cheaper than SMS.

Setting up Twilio SMS (what it actually takes)

Five tasks, not one. Most tutorials skip steps 3 and 4, which is where things break in production.

1

Create account, provision a number

US local: $1.15/mo. Toll-free: $2.15/mo. UK mobile: $2.50/mo. Finland mobile: $5/mo.

2

Create a Messaging Service

Add your number to its sender pool. This is how Twilio routes inbound/outbound through your app.

3

Register for 10DLC (US) or verify toll-free

This is where most people stall. 10DLC needs business identity, campaign use case, sample messages, and proof of opt-in.$4 brand fee, $2/mo campaign fee. Without it, carriers filter your messages. Since January 2024, unverified toll-free is blocked too.

4

Wire webhooks and status callbacks

Inbound messages hit your webhook. Delivery events hit your status callback. If you skip this, you have a fire-and-forget sender, not an agent. Monitor for Twilio error 30007 (carrier filtered) from day one.

5

Build your agent logic

Persist state under a thread key (channel + user + business). Store transcript history, extracted fields, and thread state (active, waiting, needs_human, closed). The channel is stateless. If you don't persist context yourself, it vanishes between turns.

Setting up WhatsApp Business (app vs API)

WhatsApp Business App

Free

  • 1 phone + 4 linked devices
  • Labels, catalogs, quick replies
  • Greeting and away messages
  • Good for a solo operator

WhatsApp Business Platform (API)

Paid, per message

  • Multiple agents, CRM sync, bot logic
  • Programmatic lead handling
  • Template approval and quality system
  • Required once you need automation

The 24-hour window that controls everything

When a customer messages you, a 24-hour timer starts. Inside that window: free-form replies and free utility templates. Outside it: only approved templates at Meta pricing. If the customer arrived from a Click-to-WhatsApp ad, you get 72 hours free.

This is why WhatsApp works well for customer-initiated conversations (support, inquiries, lead capture) but gets more expensive for outbound marketing.

Compliance: the part nobody wants to read

What are the US SMS compliance rules?

Consumers can revoke consent at any time, in any reasonable way. The FCC's 2024 order requires brand-specific opt-in for each business. STOP, end, unsubscribe, cancel must all be honored. Carrier filtering is strict and getting stricter.

What are the Canadian SMS rules?

SMS and messaging require consent, sender identification, and an unsubscribe mechanism. You can't send a commercial text just to ask for consent.

What are the EU and UK messaging rules?

Direct marketing by SMS requires specific consent. Some existing-customer exceptions exist (soft opt-in), but assume prior consent unless local counsel says otherwise. Maintain suppression lists and a working opt-out.

What are WhatsApp's messaging policies?

Meta requires the business name to be stated in the opt-in. Template quality ratings (green/yellow/red) control your throughput. Low quality pauses your templates. Repeated policy violations restrict your account. The biggest causes of trouble: vague opt-ins, misclassifying templates, high frequency to stale lists.

What it costs at 100, 1,000, and 10,000 conversations

Scenario100/mo1,000/mo10,000/mo
US SMS (10 msgs each)$12-14$120-140$1,200-1,400
WhatsApp, customer-initiated$1-2$11-15$110-150
WhatsApp, business-initiated (NA)$3.60$36$360
WhatsApp, business-initiated (UK)$6.40$64$640

LLM cost adds roughly $1 per 100 conversations on a cheap model. Transport, not AI, drives the bill. For more on costs, see what an AI agent actually costs to run.

Four operational pitfalls

Silent filtering (SMS)

Twilio error 30007: carrier filtered your message. No bounce, no error to the user. Just silence. Monitor undelivered rates from day one.

Quality decay (WhatsApp)

Meta's quality rating system throttles you before you know it. Sending too often, misclassifying templates, or using stale opt-ins triggers pacing, pausing, and messaging limits.

AI owns compliance decisions

STOP, unsubscribe, help, complaint, refund: these must be trapped in deterministic logic before the LLM sees them. Otherwise the model continues a sales pitch after someone says "stop."

Identity confusion

Users don't know who they're talking to. Disclose your business name and that replies may be automated. This one design choice cuts complaints, blocks, and "is this spam?" reactions.

Where to start

Start with notifications, not conversations. Lead alerts, appointment reminders, order confirmations, "reply YES to continue" flows. This captures most of the business value with far less state management. Upgrade to a full conversational agent only when customers naturally ask follow-ups, you need after-hours coverage, and you already have threading, suppression, monitoring, and human handoff designed.

Frequently asked questions

Should I use SMS or WhatsApp for my business agent?

SMS if your customers are in the US or Canada. Every mobile number can receive it, and North America is still far less WhatsApp-centric than other markets. WhatsApp if your customers are in Europe, Latin America, or South/Southeast Asia. Ofcom (2025) reports WhatsApp reached 90% of UK adults. In many markets, WhatsApp is the default messaging channel.

How much does it cost to run an SMS agent?

A 10-message US SMS conversation (6 outbound, 4 inbound) on Twilio costs roughly 11-13 cents in transport plus about 1 cent in LLM cost. At 1,000 conversations per month: $120-$140 plus a few dollars for the number and campaign registration. Multi-segment messages and international routing push this up.

How much does a WhatsApp agent cost?

If the customer starts the conversation, service replies inside the 24-hour window are free on the Meta side. Transport cost can be effectively zero, leaving just LLM and hosting. 1,000 customer-initiated conversations: roughly $11-$15 total. Business-initiated outreach adds a template fee: about 3.6 cents per conversation in North America, 6.4 cents in the UK.

What is 10DLC and do I need it?

10DLC (10-digit long code) is the US carrier registration system for business SMS. It requires your business identity, campaign use case, sample messages, and proof of opt-in. Twilio charges a $4 one-time brand fee and $2/month campaign fee. Without it, your messages will be filtered or blocked by carriers since January 2024.

What is the WhatsApp 24-hour service window?

When a customer messages your business on WhatsApp, a 24-hour timer starts. During that window you can send free-form replies and free utility templates. After it closes, you can only send approved template messages at Meta pricing. Customer service conversations that stay in-window are effectively free on the Meta side.

How do I handle human handoff in a messaging agent?

Design handoff before the first live send, not after the first failure. The AI handles first-line triage, gathers basics, writes a conversation summary, then stops sending once a human takes over. Letting the AI continue after handoff creates contradictions and destroys trust. Trap STOP, help, complaint, and legal keywords in deterministic logic before the LLM sees them.

localbot contact

Skip the Twilio setup?

localbot handles SMS delivery, phone number provisioning, compliance, and threading. You add one script tag. Leads arrive on your phone in seconds.

Book a demo

$99/mo flat. No Twilio account, no webhook config, no 10DLC paperwork.