Updated

How to Connect an AI Agent to WhatsApp

You can link a WhatsApp device. You can also use Meta's official WhatsApp Business Cloud API, a business system for sending and receiving messages. A third way to connect uses an outside messaging gateway, a service that passes messages between WhatsApp and your agent. The right option depends on your agent software. It also depends on who you message and which setup work you can manage.

The short answer

Start with the connection your agent already supports.

OpenClaw links through WhatsApp Web. Hermes offers a similar link through Baileys and a separate connection to Meta's Cloud API. Start with the option already built into your agent. Add another service only when you need something the built-in option cannot do.

A WhatsApp chatbot is a program that answers inside the chat. An AI agent may also use an AI model or approved tools. Both need one of these ways to connect before they can receive or send a reply.

Write down the option name before you start. “WhatsApp connection” is too vague when one option uses a QR code and another uses a business API with a webhook. A webhook is a secure public web address that receives messages.

One clear picture

The connection carries messages; the agent decides what to do.

PERSONWhatsApp chatSends an allowed message
CONNECTIONDevice, API, or gatewayPasses the message
AGENTModel and approved toolsBuilds a reply or takes an allowed action

Hosting keeps the agent online. It does not give the agent permission to contact people. The WhatsApp connection, agent access rules, and tool permissions are separate choices.

Three connection shapes

Each way to connect gives you a different setup job.

WAY 1

A linked WhatsApp device

How it works
The agent links to a WhatsApp account with a QR code. OpenClaw and Hermes both use Baileys, a tool that connects through WhatsApp Web.
Your work
The agent gateway must keep running. You must protect the saved WhatsApp session and control who may message the agent.
Important limit
This is not the official WhatsApp Business Cloud API. WhatsApp can change its web connection, and its terms still apply.
WAY 2

The official WhatsApp Business Cloud API

How it works
Meta sends incoming business messages to a secure public web address, called a webhook. That address passes the message to your agent.
Your work
You need a WhatsApp Business Account, a Meta app, a business phone number, secret access codes called tokens, and a public HTTPS address that protects data while it travels.
Important limit
Business messaging rules apply. You need permission to contact people, and some messages need an approved template.
WAY 3

An outside messaging gateway

How it works
Another messaging service can pass the message and the needed details to your agent or customer system.
Your work
Check exactly which WhatsApp connection the service uses. Find out where messages and contact data are stored, and how the service protects keys.
Important limit
A gateway does not remove WhatsApp rules or local laws. It is a separate product, not a built-in OpenClaw or Hermes channel.

Next step:See how one product connects

A simple option check

Match the connection to the real job.

QuestionOption to checkCheck before setup
Does your agent have a built-in WhatsApp channel?Linked-device optionWhere it saves the WhatsApp login and how it blocks unknown senders
Will customers use it to contact your business?Official Cloud API optionBusiness account and webhook. Also check approved templates and the support path.
Must messages also enter a tool that stores customer details, or another app?Outside gateway or direct app integrationCheck where messages go, what is saved, and who owns the account.
Are you only learning?Local test with a dedicated numberDo not invite real users until access and stop rules work

Keep the ways to connect separate

See how OpenClaw, Hermes and VoidFix connect.

OpenClaw

OpenClaw's built-in channel uses a linked WhatsApp Web session. Its Gateway owns the live connection. This connection is not an outside gateway and is not Meta's Cloud API.

Follow the OpenClaw setup guide

Hermes Agent

Hermes offers two connection options: a linked-device Baileys bridge and an official WhatsApp Business Cloud API connection. Choose one before following its setup steps.

Compare the two Hermes options

Outside gateway example

VoidFix documents a separate QR-linked WhatsApp setup. It is not built into OpenClaw or Hermes, and it is not Meta's Cloud API. We have not tested delivery or compatibility with either agent.

See how VoidFix connects

Before the first real message

Protect people, the account, and the agent tools.

  1. 01

    Get clear permission. Tell people what kinds of messages they will receive and how often.

  2. 02

    Honor every stop request. Remove the person from future messages when they ask you to stop.

  3. 03

    Limit who can reach the agent. Use pairing or a fixed list of approved phone numbers while testing. Do not leave a tool-enabled agent open to strangers.

  4. 04

    Protect secrets. Never publish QR codes, saved sessions, access tokens, app secrets, or webhook secrets.

  5. 05

    Limit agent tools. A message can contain harmful instructions. Give the agent only the tools and files it needs.

WhatsApp Business requires opt-in permission and says businesses must honor requests to stop. Local laws may add more duties. Check the rules for every country where you send messages.

Keep the connection available

An always-on agent needs an always-on gateway.

You can test on your own computer. If the agent must reply while that computer is off, run the agent gateway on a suitable always-on computer, a VPS (a virtual computer that stays online), or a managed service. The Cloud API also needs a public HTTPS webhook that Meta can reach.

Next step:Learn how AI agent hosting works

What supports this guide

Read the guides and rules used for this page.

Sources checked August 26, 2026. Product steps and messaging rules can change. We did not test delivery, account limits, or uptime for this guide. This page is general information, not legal advice.

Next step:Compare SMS and WhatsApp

Straight answers

WhatsApp AI agent questions.

Is a WhatsApp chatbot the same as a WhatsApp AI agent?

A chatbot is any program that answers in a chat. An AI agent can also use an AI model or approved tools. Both still need a supported WhatsApp connection and clear access rules.

Can an AI agent reply to WhatsApp messages?

Yes, when a supported connection passes the message to the agent and the agent is running. You must still limit who can reach it and what tools it may use.

Does OpenClaw need a separate WhatsApp gateway?

Not for its documented built-in WhatsApp channel. OpenClaw links a WhatsApp account through its own channel plugin and keeps the session in the OpenClaw Gateway.

Does Hermes Agent use the official WhatsApp API?

Hermes documents two ways to connect. Its Baileys option links a device through WhatsApp Web. Its Cloud API option uses Meta's official WhatsApp Business platform.

Is a QR-code connection the WhatsApp Cloud API?

No. A QR code normally links a device or web session. The Cloud API uses a WhatsApp Business Account, a Meta app, credentials, and a webhook.

Do I need a VPS for a WhatsApp AI agent?

Not while you are only testing on your own computer. You need an always-on computer or service when messages must be handled while your computer is off.

Can I message any phone number after setup?

No. Get clear permission, explain what messages the person will receive, honor every stop request, and follow the rules for the person's country and messaging channel.

Choose an option first

Choose the connection before adding another service.

Compare a linked device, Cloud API, and a separate messaging service. Then follow the setup that matches your agent and message job.

Compare the three options