← Blog

Claude Chatbot on WhatsApp: How to Actually Build One

2026-09-10 · 5 min read · SubToAPI Team

Anthropic does not offer an official Claude chatbot on WhatsApp. There's no "message Claude on WhatsApp" number you can add to your contacts, and no first-party integration in the works that's been announced. If you've searched for this hoping to find a ready-made bot, that's the short answer: it doesn't exist as an Anthropic product.

What does exist is a straightforward way to build your own Claude-powered WhatsApp bot using the WhatsApp Business Platform (via Meta's Cloud API or a provider like Twilio) plus the Claude API for the actual language understanding and responses. This is a common pattern for customer support bots, personal assistants, and internal tools, and it's not particularly hard to set up if you understand the moving pieces.

Why there's no official Claude WhatsApp app

WhatsApp doesn't allow third-party AI providers to run a generic assistant on the platform the way Claude.ai works in a browser. Every business account on WhatsApp needs to be registered through Meta (or a Business Solution Provider), tied to a phone number, and approved for the message types it sends. Anthropic building a consumer-facing "Claude on WhatsApp" product would mean owning that registration, moderation, and support burden for a channel it doesn't otherwise operate in. It's simpler for Anthropic to expose the Claude API and let developers wire it up themselves — which is exactly what thousands of teams already do.

The architecture you actually need

A Claude WhatsApp bot has three parts:

  1. WhatsApp Business API (Meta Cloud API or Twilio) — receives incoming messages via webhook, sends outgoing messages via REST call.
  2. Your backend — a small server that receives the webhook, extracts the user's message, calls Claude, formats the reply, and sends it back.
  3. Claude API — generates the actual response, optionally with conversation history and tool calls.

The backend is the piece most people underestimate. It needs to:

A minimal example

Here's the shape of the webhook handler, using Claude through SubToAPI so the Claude call is a plain HTTPS request with your own API key:

// webhook.js — receives WhatsApp messages, replies with Claude
import express from "express";
const app = express();
app.use(express.json());

const conversations = new Map(); // phone number -> message history

app.post("/webhook", async (req, res) => {
  const entry = req.body.entry?.[0]?.changes?.[0]?.value;
  const message = entry?.messages?.[0];
  if (!message) return res.sendStatus(200);

  const from = message.from;
  const text = message.text?.body;
  const history = conversations.get(from) || [];
  history.push({ role: "user", content: text });

  const claudeRes = await fetch("https://api.subtoapi.app/v1/messages", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: "claude-sonnet-4-5",
      max_tokens: 512,
      messages: history
    })
  });

  const data = await claudeRes.json();
  const reply = data.content[0].text;
  history.push({ role: "assistant", content: reply });
  conversations.set(from, history.slice(-20)); // keep last 20 turns

  await sendWhatsAppMessage(from, reply);
  res.sendStatus(200);
});

async function sendWhatsAppMessage(to, body) {
  await fetch(`https://graph.facebook.com/v20.0/${process.env.WA_PHONE_ID}/messages`, {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.WA_TOKEN}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      messaging_product: "whatsapp",
      to,
      text: { body: body.slice(0, 4000) } // WhatsApp text limit
    })
  });
}

This is deliberately minimal — no persistence, no retry logic, no queueing — but it's the actual skeleton every Claude WhatsApp integration uses.

Where SubToAPI fits

The Claude call in that example goes through SubToAPI, which turns your existing Claude access into a standard HTTPS endpoint with an application key (sub_live_...). For a WhatsApp bot specifically, this matters because:

Setup is a signup, an API key, and the standard /v1/messages call shown above — see /docs/quickstart and /docs/messages for the full request format. Plans start at €9/month for solo use; see /pricing.

Practical things people get wrong

Session memory. Claude doesn't remember previous WhatsApp messages unless you send them back in the messages array on every call. Store history per phone number in a database, not in memory — a restart will wipe an in-memory map and confuse every ongoing conversation.

Message length. WhatsApp text messages cap around 4096 characters. Claude can easily produce longer output, especially for anything analytical. Either instruct Claude to keep replies short via the system prompt, or split long replies into multiple WhatsApp messages.

24-hour session window. WhatsApp Business API restricts free-form replies to within 24 hours of the user's last message. Outside that window you need a pre-approved template message. This is a WhatsApp platform rule, not a Claude limitation, but it will break your bot if you don't account for it.

Streaming doesn't map cleanly. WhatsApp isn't a streaming medium — messages arrive whole. If you use /docs/streaming on the Claude side, buffer the full response server-side before sending it to WhatsApp rather than trying to push partial tokens.

questions

Does Anthropic have an official Claude bot on WhatsApp? No. There's no Anthropic-run WhatsApp number or bot. Any Claude presence on WhatsApp is built by a developer connecting the WhatsApp Business API to the Claude API.

What do I need to build a Claude WhatsApp bot? A WhatsApp Business API account (via Meta Cloud API or a provider like Twilio), a small backend server to handle webhooks and call Claude, and a Claude API key — for example a sub_live_... key from /signup.

Can the bot use tools like order lookups or database queries? Yes. Claude's tool use works the same way over WhatsApp as anywhere else — your backend calls Claude with tool definitions, executes the requested function, and sends the result back before replying to the user. See /docs/tools for the request format.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →