Skip to content
meirlabs
Back to all articles
Meir RosenscheinJuly 9, 2026Updated July 10, 20266 min read

How Do You Connect an AI Agent to a WhatsApp Group?

TL;DR

You can't with the official WhatsApp API; it only creates its own invite-link groups and can't join one you already have. What works: a spare prepaid number, linked as a device to an agent runtime like OpenClaw on a small server, added to your group as a normal member. It rides an unofficial client, so treat that number as expendable; everything it captures lives on your server, not in WhatsApp.Launch offer: Early clients get 50% off their first build, so your real cost is about half these figures. Book a free AI plan to lock it in.

By the numbers
$6–12A month out of pocket: the prepaid number plus a small server
15 minTo recover from a ban: new SIM, re-pair, back in the group
2 hoursTo go from nothing to tickets appearing from chat messages

I built this for my own product's founder group, two people running a company out of one WhatsApp thread with every task and document drowning in it. The goal was a quiet third member that turns messages into tickets. Here's the setup that works.

Why can't you just use the official WhatsApp API?

Meta's Groups API only lets a business create its own groups, joined by invite link and capped at 8 people. There's no endpoint for joining a group that already exists between two normal accounts. That one limit rules out every official-API platform for this job. Anything that can join your group is riding an unofficial client underneath.

How do you set it up, step by step?

Three pieces do the work: a dedicated phone number added to your group as a normal member, an unofficial linked-device client built on Baileys (a reverse-engineered WhatsApp Web library) that lets a server send and receive as that number, and an agent runtime, OpenClaw, as the brain. Six steps, about two hours.

Your WhatsApp groupthe members, plus the bot's prepaid number added as a normal member
OpenClaw on a small VPSsigned in as that number, like a linked device (Baileys)
Claudereads, classifies, stays silent unless addressed
Linear ticketstasks, deduped
Document librarysearchable
Back in the groupanswers + emoji receipts
The whole setup in one shape: the bot rides a normal number as a linked device, the one thing the official API can't do, and everything it captures lands on your server and in Linear, not inside WhatsApp.
  1. Get a dedicated number. A prepaid eSIM or SIM with a real mobile number, not a VoIP one (WhatsApp blocks those). Register a fresh WhatsApp account on it; the Business app lets it share a phone with your personal account.

  2. Stand up OpenClaw and connect it to Claude. Any $5–10 a month VPS is plenty. Install OpenClaw, then give it your Anthropic API key so its agent runs on a Claude model. WhatsApp ships as an OpenClaw plugin. This OpenClaw setup walkthrough covers install and pairing end to end.

  3. Pair the number. Start the WhatsApp login and scan the QR from the bot's phone under Linked Devices, exactly like WhatsApp Web.

  4. Add the bot to your group. Add its number like any member and it sees every message. Admit that one group and set the agent to read all of it, not just messages that tag it.

  5. Give it instructions and tools. This is the whole product; the other five steps are plumbing. The system prompt classifies every message (task, decision, question, document, fyi) and carries the behavior rules. These took real debugging; paste them close to literally:

    • "Any text you produce gets posted to the group. Between tool calls, output nothing; your only text output is a silent end token."
    • "React after the work, not instead of it: one emoji per message, as a receipt."
    • "Before creating a ticket, search for an existing one. One ask must never spawn five tickets."
    • "You are addressed only by an @mention or a reply to you. A plain imperative in the chat is a task to file, not a question to answer."

    The tools are small scripts the agent calls: create a Linear ticket, file a shared document, search past messages. Small scripts beat heavy integrations.

  6. Add the safety net. Log every inbound message to your own database, separate from the agent, and reconcile it against tickets daily. This is the step people skip and regret.

Out-of-pocket cost is $6–12 a month all-in: a dollar or two for the number, the rest for the VPS. Everything else is model usage on your own API key, scaling with how busy the group is.

What does it actually do with the messages?

Reading is the easy part; the value is what it does next.

  • Tasks become Linear tickets. "Send the investor deck by Friday" becomes a ticket in the right Linear team. Linear stays the to-do list; the chat goes back to being a chat.

  • It reacts instead of replying. One emoji as a receipt: a checkmark for a ticket, a folder for a filed document, a pin for a decision. No noise in the thread, and you see at a glance what got captured.

  • Documents land in a searchable library. A dropped PDF gets read, summarized, and indexed, findable later by what's in it.

  • It answers questions about the group's history. Mention it with "what did we decide about pricing" and it replies from the full log, then goes quiet.

How do you contain the ban risk?

Accept it, then isolate it. Unofficial clients break WhatsApp's terms, and ban waves catch even low-volume accounts, so treat the bot's number as expendable. That's the whole strategy: your personal and business numbers never touch the automation, and a banned bot is a new prepaid SIM and a fifteen-minute re-pair. Keep a spare. Everything that matters, tickets, documents, message history, lives on your server and in Linear, not in WhatsApp.

Can one bot serve several groups and projects?

Yes: sessions are per group, so one bot number can sit in many groups without contexts bleeding, and a per-group system prompt ("this group is project B, tickets go to that team") covers most cases. One wiring gotcha: a Linear API key only sees its own workspace, so a project in a different Linear workspace needs its own key. It's still one number though, so a ban takes every group down at once; keep external collaborators on a separate number.

What breaks first?

Four things bit me, and each failed silently before it got a rule:

  • The bot narrated its work into the chat. Fix: the silence rule from step 5, exactly as quoted.
  • Emoji reactions failed silently in groups. Fix: don't pass an explicit message ID in the reaction call; let the client work out the participant itself.
  • A message vanished during a session restart. Fix: the step 6 log and daily reconcile; the agent can fail, the log can't.
  • Timeouts pushed work to the cheapest fallback model, which follows rules worse. Fix: raise the timeout, put a mid-tier model ahead of the cheap one, and write every rule assuming the weakest model is the one reading it.

A simple rule to start: give the bot its own expendable number and its own independent message log. Everything else that goes wrong is recoverable from those two.

Can you skip the setup and hand it to Claude Code?

Yes, and it's the fastest path if you already use Claude Code. I packaged this whole playbook, architecture, OpenClaw config, prompt rules, every gotcha, into an installable skill. Install it and ask Claude Code to set the bot up:

npx @meir-labs/skill-whatsapp-group-agent

The full skill is here: whatsapp-group-agent. Same one I run, minus my own server specifics.

Want this running in your group without building it yourself?

That's the part I do. If you'd rather not stand up a server and tune prompts until the bot behaves, I'll set it up for you: your group, wired into your Linear, tickets appearing from chat by the end. The free AI plan below is where it starts.

Sources