How to Set Up an AI WhatsApp Assistant
WhatsApp is the world's most popular messaging platform with over two billion users. Connecting your OpenClaw AI agent to WhatsApp allows you to reach customers, clients, and users on the platform they already use daily. Whether for customer support, personal assistance, or business automation, a WhatsApp AI assistant meets people where they are.
In this guide, you will set up a WhatsApp Business account, configure the WhatsApp Cloud API, connect it to your EZClaws agent, and test the integration. The result is an AI assistant that responds to WhatsApp messages automatically with the full power of OpenClaw.
Prerequisites
Before starting, gather the following:
- A running OpenClaw agent on EZClaws — Deploy one using our deployment guide.
- A Meta (Facebook) Business account — Create one at business.facebook.com if you do not have one.
- A phone number for WhatsApp Business — This must be a number not already registered with personal WhatsApp. A new SIM card or virtual number works.
- An active EZClaws subscription — WhatsApp messaging can generate significant usage. See plans at /pricing.
Step 1: Set Up WhatsApp Business API Access
Navigate to the Meta for Developers portal and create a new app or use an existing one.
Create a Meta App
- Click Create App on the developer portal.
- Select Business as the app type.
- Fill in the app name and contact email.
- Select your Meta Business account.
- Click Create App.
Add WhatsApp Product
On your app's dashboard:
- Find WhatsApp in the product list and click Set Up.
- Follow the prompts to link your Meta Business account.
- Meta provides a test phone number and a temporary access token for development.
Get Permanent Access Token
The test token expires after 24 hours. For production use, generate a permanent token:
- In the Meta Developer Portal, go to System Users under your Business Settings.
- Create a System User with Admin role.
- Generate a token with
whatsapp_business_messagingandwhatsapp_business_managementpermissions.
# Your permanent access token will look like:
EAAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Register Your Phone Number
To use your own phone number instead of the test number:
- Go to WhatsApp > Getting Started in your app settings.
- Click Add phone number.
- Enter the phone number and verify it via SMS or voice call.
- The number must not be registered with WhatsApp personal or WhatsApp Business app.
Step 2: Configure the Webhook
WhatsApp sends incoming messages to your agent via a webhook. You need to configure this webhook URL in the Meta Developer Portal.
Set Up Webhook in Meta
- Go to your app's WhatsApp > Configuration page.
- Click Edit next to the Webhook field.
- Enter your agent's WhatsApp webhook URL:
Callback URL: https://your-agent-domain.up.railway.app/whatsapp/webhook
Verify Token: your-custom-verify-token
The verify token is a secret string you choose. It is used to verify that webhook requests are coming from Meta. Enter the same token in both the Meta portal and your EZClaws skill configuration.
- Click Verify and Save. Meta will send a verification request to your agent's endpoint.
Subscribe to Webhook Events
After verification, subscribe to the messages webhook field. This tells Meta to send incoming WhatsApp messages to your agent.
Subscribed fields:
- messages — Incoming messages from users
Step 3: Install the WhatsApp Skill on EZClaws
Navigate to the EZClaws skills marketplace at /app/marketplace and find the WhatsApp integration skill.
Install it on your agent and configure the following:
Required Configuration
WhatsApp Access Token: EAAxxxxxxxxxxxxxxxxxxxxxxxx (from Step 1)
Phone Number ID: 123456789012345 (from your WhatsApp Business settings)
Webhook Verify Token: your-custom-verify-token (must match Meta configuration)
Business Account ID: 987654321098765 (from your Meta Business settings)
Optional Configuration
Default Language: en
Response Timeout: 30 seconds
Media Processing: enabled
Read Receipts: enabled
Typing Indicator: enabled
Save the configuration. Your agent will begin listening for incoming WhatsApp messages.
Step 4: Configure Message Templates
WhatsApp Business requires pre-approved message templates for proactive messaging (messages sent outside the 24-hour response window).
Create Templates in Meta
- Go to WhatsApp > Message Templates in the Meta Business Manager.
- Click Create Template.
- Choose a category (Marketing, Utility, or Authentication).
- Write your template with variable placeholders.
Example templates:
Template: welcome_message
Category: Utility
Body: "Hi {{1}}, thanks for reaching out! I'm an AI assistant
powered by EZClaws. How can I help you today?"
Template: follow_up
Category: Utility
Body: "Hi {{1}}, just checking in regarding your question about {{2}}.
Is there anything else I can help with?"
Template: support_resolution
Category: Utility
Body: "Hi {{1}}, your issue regarding {{2}} has been resolved.
If you need further assistance, just reply to this message."
Submit templates for approval. Meta typically reviews templates within 24 hours.
Configure Template Usage
In your agent's system prompt, include instructions about when to use templates:
WHATSAPP TEMPLATE RULES:
- When a user has not messaged in more than 24 hours, use the "follow_up"
template to re-engage
- For new users messaging for the first time, acknowledge with the
"welcome_message" template
- After resolving an issue, send the "support_resolution" template
Step 5: Configure Agent Behavior for WhatsApp
WhatsApp has unique characteristics that your agent should account for:
System Prompt Template
You are an AI assistant available on WhatsApp for [Business Name].
WHATSAPP-SPECIFIC GUIDELINES:
- Keep messages concise — WhatsApp users expect brief, chat-style responses
- Use short paragraphs and line breaks for readability on mobile
- Use WhatsApp formatting: *bold*, _italic_, ~strikethrough~, ```monospace```
- For long responses, break into multiple messages
- Respond promptly — users expect quick replies on WhatsApp
- Use emoji sparingly to feel natural and friendly
MEDIA HANDLING:
- When a user sends an image, analyze it and respond appropriately
- When a user sends a document, read and summarize if relevant
- When a user sends a voice note, transcribe and respond to the content
CONVERSATION MANAGEMENT:
- Greet new users and explain your capabilities
- For complex issues, ask clarifying questions one at a time
- Offer to connect users with a human agent for sensitive matters
- Track the 24-hour messaging window and use templates when needed
PRIVACY:
- Do not ask for sensitive information (passwords, credit card numbers)
- Inform users that conversations are processed by AI
- Respect opt-out requests immediately
Step 6: Test the Integration
Test your WhatsApp assistant thoroughly before making it available to users:
Test with the Test Number
Meta provides a test phone number during setup. Use it for initial testing:
- Add the test number to your WhatsApp contacts.
- Send a message to the test number.
- Verify the agent responds correctly.
Test with Your Production Number
After verifying with the test number, switch to your registered phone number:
- Send a message from your personal WhatsApp to the business number.
- Verify the response arrives and is correctly formatted.
Test Scenarios
Test 1: Text message
Send: "Hi, what can you help me with?"
Expected: Welcome message with capabilities
Test 2: Image message
Send: [photo of a product]
Expected: Agent describes or analyzes the image
Test 3: Document message
Send: [PDF document]
Expected: Agent reads and summarizes the document
Test 4: Multiple messages
Send several messages in quick succession
Expected: Agent processes and responds to each
Test 5: Long conversation
Have a multi-message conversation spanning several topics
Expected: Agent maintains context throughout
Test 6: Template message test
Wait 24+ hours, then try to send a follow-up
Expected: Agent uses an approved template
Step 7: Go Live
Once testing is complete, prepare for production use:
Display Name Verification
Apply for a display name for your WhatsApp Business number:
- Go to WhatsApp > Phone Numbers in Meta Business Manager.
- Request a display name that represents your business.
- Meta will verify the name against your business information.
Quality Rating
Meta monitors the quality of your WhatsApp messages based on user feedback. Maintain a high quality rating by:
- Responding quickly and accurately.
- Not sending spammy or irrelevant messages.
- Respecting user opt-out requests.
- Using templates appropriately.
Promote Your WhatsApp Assistant
Share your WhatsApp number with customers through:
- Your website with a "Chat on WhatsApp" button.
- Email signatures.
- Social media profiles.
- Business cards and marketing materials.
- QR codes linking to
https://wa.me/your_number.
<!-- WhatsApp chat link for your website -->
<a href="https://wa.me/1234567890?text=Hi,%20I'd%20like%20to%20know%20more">
Chat with us on WhatsApp
</a>
Troubleshooting
Messages are not reaching the agent
- Verify webhook configuration — Check that the webhook URL is correct in Meta's portal.
- Check agent status — Ensure the agent is "Running" on the EZClaws dashboard.
- Verify access token — Make sure the permanent access token has not expired.
- Check webhook subscriptions — Verify the
messagesfield is subscribed.
Agent responds but messages are not delivered to WhatsApp
- Check access token permissions — Ensure
whatsapp_business_messagingpermission is granted. - Verify phone number ID — Ensure the correct Phone Number ID is configured.
- Check Meta app status — Your Meta app must be in "Live" mode for production use.
- Review rate limits — Meta imposes message rate limits based on your quality rating.
24-hour window issues
- Use templates — For messages outside the 24-hour window, use approved templates.
- Track windows — Have the agent track when each user's 24-hour window opens and closes.
- Prompt engagement — Encourage users to message again if you need to continue the conversation.
Poor response quality
- Refine system prompt — Add WhatsApp-specific formatting and behavior instructions.
- Upgrade model — Use GPT-4o or Claude for better conversational quality.
- Add context — Provide the agent with information about your products, services, and common questions.
- Enable memory — Persistent memory improves conversation quality over time. See memory guide.
Compliance and Best Practices
WhatsApp Commerce Policy
Ensure your AI assistant complies with WhatsApp's Commerce and Business policies:
- Do not use WhatsApp for sending unsolicited promotional messages.
- Obtain user consent before adding them to automated messaging.
- Provide a clear opt-out mechanism.
- Do not impersonate other businesses or individuals.
Data Privacy
- Inform users that messages are processed by AI.
- Comply with GDPR and other applicable privacy regulations.
- Do not store sensitive personal data unnecessarily.
- Review your privacy policy at /privacy and terms at /terms.
User Experience
- Respond within seconds — WhatsApp users have high expectations for response time.
- Use a conversational, friendly tone appropriate for messaging.
- Provide clear options when the user needs to make a choice.
- Always offer a way to reach a human agent.
Summary
Setting up an AI WhatsApp assistant with EZClaws connects your agent to the world's largest messaging platform. The process involves creating a Meta Business account, configuring the WhatsApp Cloud API, installing the WhatsApp skill, and testing thoroughly.
A WhatsApp AI assistant is ideal for customer support, appointment booking, order tracking, FAQ handling, and general assistance. With over two billion WhatsApp users, it is a powerful channel for reaching customers where they already are.
For other messaging integrations, check out our guides for Telegram, Discord, and Slack. Explore more use cases on our use cases page and stay updated with our blog.
Frequently Asked Questions
Yes. WhatsApp's API is only available through WhatsApp Business. You can use the WhatsApp Business API through Meta's Cloud API (free tier available) or through a Business Solution Provider (BSP). A regular WhatsApp personal account cannot be connected to an AI agent.
Meta charges per conversation on the WhatsApp Business API. The first 1,000 service conversations per month are free. After that, pricing varies by country. This is in addition to your EZClaws subscription and credit costs.
Yes, with the appropriate skills installed. The agent can receive and process images, documents, and voice messages. Image understanding depends on the model provider's multimodal capabilities (GPT-4o and Claude support image analysis). Voice notes can be transcribed using speech-to-text skills.
WhatsApp's Business API has a 24-hour messaging window. After a user messages you, you can send unlimited messages for 24 hours. After that, you can only send pre-approved template messages. Your agent should be configured to respond promptly and include template messages for re-engagement.
No. The WhatsApp Business API requires a dedicated phone number that is not registered with a personal WhatsApp account. You need a separate number for your AI assistant.
Explore More
From the Blog
Everything you need to know about managing API keys for your AI agent. Covers key generation for OpenAI, Anthropic, and Google, plus security best practices, cost controls, and rotation.
11 min read25 AI Agent Automation Ideas You Can Set Up TodayDiscover 25 practical AI agent automation ideas for business, productivity, community, and personal use. Each idea includes what the agent does, who it helps, and how to set it up on EZClaws.
16 min readAI Agent for Customer Support: A Real-World Case StudySee how a growing e-commerce company deployed an AI agent for customer support using OpenClaw and EZClaws, reducing response times by 85% and handling 70% of tickets autonomously.
12 min readReady to Deploy Your AI Agent?
Our provisioning engine spins up your private OpenClaw instance — dedicated VM, HTTPS endpoint, and full autonomy in under a minute.
