Claude Code

Give Claude aWhatsApp number

Your AI agent gets its own WhatsApp line. It answers, checks your calendar, books and follows up, without touching your phone. Built on the official Cloud API.

  • ToolClaude Code
  • TimeAn afternoon
  • You needClaude Code, Kapso account, a +61 or +64 number
  • Reel keywordNUMBER

Your AI agent gets its own WhatsApp line. It answers, checks your calendar, books and follows up, without touching your phone. Built on the official WhatsApp Cloud API.

Read this before you build

Two things changed this year and most WhatsApp guides haven’t caught up.

1. Replies aren’t free anymore. From 1 October 2026, Meta charges per message for every reply you send inside the 24-hour window. Each business number gets 1,000 free service messages a month, then you pay your country’s rate.

2. Build it for your business, not as a general chatbot. Since 15 January 2026, WhatsApp’s terms only allow general-purpose AI assistants where Meta is legally required to. An agent that answers questions about your business, bookings and services is fine. A “chat to Claude about anything” bot is not.

Why a number changes things

Connectors let Claude read and reply inside your existing accounts. What they don’t give it is a line of its own. Until your agent has its own number, it can’t greet a customer at midnight, chase a quote on day three, or confirm a booking while you sleep.

So the job changes. It stops being an assistant you talk to, and starts talking to other people for you.

Stay on the official Cloud API. Tools that log in as you or run a modified WhatsApp client get numbers banned. Once a business number is gone, it’s gone.

Step 1: Get an Aussie or Kiwi number

This guide uses Kapso, which connects directly to Meta’s WhatsApp Cloud API. Its free plan covers testing.

The quick-start number Kapso gives you is American. It works for testing, but your customers are on +61 and +64 numbers, and a US number messaging them looks like spam. For anything real, bring your own Australian or New Zealand number. Kapso supports numbers from any country.

What number can you use?

Meta’s rules for a business number:

  • You have to own it.
  • It has to receive an SMS or a voice call, so Meta can send the 6-digit verification code.
  • It can’t already be on WhatsApp. If it’s on WhatsApp or the WhatsApp Business app, delete that account first (or use the Business app option in the table below).
  • Mobiles are easiest. Landlines work too, but they have to verify by voice call instead of SMS.

The easiest way: a prepaid SIM or eSIM

  1. Get a prepaid SIM or eSIM from any Australian (+61) or New Zealand (+64) carrier. An eSIM works the same way, as long as it comes with a real phone number that can receive texts. Data-only travel eSIMs don’t have one, so they won’t work.
  2. Put it in any phone and activate it. Don’t install WhatsApp on it.
  3. In Kapso, choose Bring your own SIM and enter the number.
  4. Meta texts a 6-digit code to that SIM. Enter it in Kapso. If the text doesn’t arrive, switch to phone call verification.
  5. Keep the SIM topped up and somewhere safe. Don’t let the number lapse.

Already have a business landline your customers know? Use that instead and verify by voice call.

Heads up: connecting the number doesn’t skip Meta’s checks. Display name review, business verification and template review can still apply before you’re sending at full volume.

Good to know: Meta prices messages by your customer’s country code, not yours. A US number doesn’t make messages to Aussies any cheaper.

All three options

Option What you get Best for
Kapso number A US number Kapso provides, no SIM needed Testing and prototypes
Your own number Any number you own, verified once A real Aussie or Kiwi business
WhatsApp Business app Keep using the app, Kapso runs alongside it Teams already on the app

Testing? The provided US number is fine. Throw it away later.

Real business in Australia or New Zealand? Use your own +61 or +64 number.

Already on the Business app? Kapso calls this coexistence. It works, but Kapso’s own docs say it’s less stable than a dedicated Cloud API connection, so move off it for production.

Never use your personal number for an automated agent. Keep the line separate from your life.

Step 2: Let Claude write the integration

You don’t need to read an API reference. Install Kapso’s agent skills in your project folder, then open Claude Code.

npx skills add gokapso/agent-skills

Optional, if you want Claude to search Kapso’s docs as it builds:

claude mcp add --transport http kapso-docs https://docs.kapso.ai/mcp

One thing a human has to do first: create a Kapso project and connect your number in the dashboard. After that, Claude can do the rest.

Then tell Claude what to build, in plain English:

Build me a WhatsApp agent for my business on Kapso. It answers questions about our services using the pricing and FAQ files in this folder, checks my Google Calendar, books appointments, and sends a reminder the morning of. If someone asks for anything it can't answer, or asks for a person, hand it to me. It only talks about my business. If someone asks it general questions, it politely says it can only help with bookings and questions about us.

Step 3: Sending and receiving

Sending is one client and one call. This is Kapso’s TypeScript SDK, straight from their docs:

import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';

const client = new WhatsAppClient({
  baseUrl: 'https://api.kapso.ai/meta/whatsapp',
  kapsoApiKey: process.env.KAPSO_API_KEY!
});

await client.messages.sendText({
  phoneNumberId: 'YOUR_PHONE_NUMBER_ID',
  to: '61400000000',
  body: 'Hey, how can I help today?'
});

Your API key lives in the Kapso dashboard under Integrations, then API keys. Your phone number ID is on the connected number.

Receiving is a webhook. When a customer messages your number, Kapso sends a POST request to your server with the event whatsapp.message.received. Your server asks Claude what to say and sends the reply back.

This is the complete working server. It’s tested end to end: a signed message comes in, Claude writes the reply, and it goes out through Kapso to the sender. Unsigned requests get rejected.

1. Set up the folder

mkdir whatsapp-agent && cd whatsapp-agent
npm init -y
npm i express @anthropic-ai/sdk @kapso/whatsapp-cloud-api

2. Save this as server.mjs

Change the BUSINESS_CONTEXT text to describe your business. That’s the only line you have to edit.

import express from 'express';
import crypto from 'node:crypto';
import Anthropic from '@anthropic-ai/sdk';
import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';

const anthropic = new Anthropic(); // reads ANTHROPIC_API_KEY
const whatsapp = new WhatsAppClient({
  baseUrl: 'https://api.kapso.ai/meta/whatsapp',
  kapsoApiKey: process.env.KAPSO_API_KEY
});

const BUSINESS_CONTEXT = `You are the WhatsApp assistant for [YOUR BUSINESS].
Only answer questions about our services, prices, hours and bookings.
If someone asks for a person or something you can't answer, say you'll pass it to the team.
If asked, say you're an AI assistant. Keep replies short, like a text message.`;

const app = express();
app.use(express.raw({ type: 'application/json' }));

function validSignature(rawBody, signature) {
  if (!signature) return false;
  const expected = crypto.createHmac('sha256', process.env.KAPSO_WEBHOOK_SECRET).update(rawBody).digest('hex');
  const a = Buffer.from(expected), b = Buffer.from(signature);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

async function handle(event) {
  const msg = event.message;
  if (!msg || msg.type !== 'text') return;
  const reply = await anthropic.messages.create({
    model: 'claude-sonnet-5-5',
    max_tokens: 400,
    system: BUSINESS_CONTEXT,
    messages: [{ role: 'user', content: msg.text.body }]
  });
  await whatsapp.messages.sendText({
    phoneNumberId: event.phone_number_id,
    to: msg.from,
    body: reply.content[0].text
  });
}

app.post('/webhook', (req, res) => {
  if (!validSignature(req.body, req.headers['x-webhook-signature'])) return res.sendStatus(401);
  res.sendStatus(200); // answer Kapso straight away, then do the work
  const payload = JSON.parse(req.body.toString());
  const events = payload.batch ? payload.data : [payload];
  for (const e of events) handle(e).catch(err => console.error(err));
});

app.listen(process.env.PORT || 3000, () => console.log('WhatsApp agent listening'));

3. Add your three keys and run it

export ANTHROPIC_API_KEY=your_anthropic_key
export KAPSO_API_KEY=your_kapso_key
export KAPSO_WEBHOOK_SECRET=your_webhook_secret
node server.mjs

Your Anthropic key comes from console.anthropic.com. Your Kapso key comes from Integrations, then API keys. You’ll get the webhook secret in step 4.

Step 4: Plug it in

Kapso needs a public web address to send messages to. Your laptop isn’t one, so you have two options:

  • Testing: run a tunnel like ngrok (ngrok http 3000) and use the https address it gives you.
  • Going live: deploy the folder to any Node host (Railway, Render, Fly) and use that address.

Then, in the Kapso dashboard:

  1. Go to Integrations, then Webhooks, then the Platform webhooks tab.
  2. Click Add Webhook and paste your address with /webhook on the end.
  3. Copy the secret key it generates into KAPSO_WEBHOOK_SECRET, then restart the server.
  4. Subscribe to whatsapp.message.received.

Now message your number from your own phone.

You’ll know it worked when you get Claude’s reply within a few seconds.

That’s the whole loop. Message in, Claude reasons, message out. Once it works, go back to Claude Code with the step 2 prompt and have it add your calendar, bookings and reminders on top of this server.

The result

A normal WhatsApp chat, answered in seconds, at any hour.

Customer: Got anything Friday? Agent: Yep, 4pm or 6:30pm are free. Which suits? Customer: 6:30 please Agent: Booked. I’ll send you a reminder Friday at noon.

Your phone stays out of it.

Bonus: put a form inside the chat

WhatsApp Flows render a real form in the conversation: bookings, catalogues, lead capture. No app to install, no link out to a website. Kapso supports Flows.

  • Use a Flow when you need more than two answers. Chat is bad at collecting five things in a row.
  • Keep chat for the conversation and the Flow for the transaction.

For builders: test properly

This is where WhatsApp agents fail quietly.

  • Use the sandbox first. Kapso has a WhatsApp API sandbox. Never test on real customers.
  • Message your number first. You can only send free-form replies once someone has messaged you, so start the test from your own phone.
  • Watch the message logs. If your agent goes quiet, it’s usually a failed webhook, not a bad prompt.
  • Track delivery status. Sent, delivered and read are three different things.
  • You, then one trusted mate, then real people.

The rules that keep you live

  • Get opt-in. Meta requires permission before you message people on WhatsApp.
  • The 24-hour window. Free-form replies only work within 24 hours of the customer’s last message. Outside it, you can only send pre-approved templates.
  • Templates need approval. Write your reminders and follow-ups early and submit them before you need them.
  • Always offer a human. Every agent needs a clean escalation path.
  • Say it’s an assistant. Not a disclaimer on every message, but never pretend to be a person when someone asks.
  • Business questions only. See the warning at the top.

What it actually costs

There are two bills and people forget the second one.

Kapso (the platform). Free plan: 2,000 WhatsApp messages a month, sent or received, and 1 connected number. Pro is 25 US dollars a month for 100,000 messages.

Meta (the delivery). Separate, and Kapso passes it through at cost with no markup. From 1 October 2026:

  • Every message you send is charged per message: templates and replies.
  • Each business number gets 1,000 free service messages a month.
  • Messages from customers to you are free.
  • The rate depends on the customer’s country code. Australia and New Zealand sit in Meta’s “Rest of Asia Pacific” pricing region.

Check Meta’s current rate card before you quote a client a monthly number.

If something breaks

Agent went silent? Check your webhook returned 200. Slow or failed responses make the platform stop delivering.

Message sent but not delivered? You’re probably outside the 24-hour window and need a template.

Template rejected? Usually promotional wording in a utility template. Resubmit in the right category.

Replies are slow? Send a quick acknowledgement, then the real answer. Silence feels broken.

Wrong answers? Almost always missing context, not a weak model. Give it your pricing, policies and FAQs.

Bill higher than expected? Count your replies. Since 1 October each one past the free 1,000 costs money.

Launch checklist

  • Your agent runs on your own +61 or +64 number, not the US test number
  • You can send and receive on the number, tested from your own phone
  • The agent has your real pricing, services, policies and FAQs
  • It only answers questions about your business
  • Human handover works and is easy to trigger
  • Reminder and follow-up templates are submitted and approved
  • You can see the message logs, so you’ll notice failures
  • You’ve checked Meta’s rate for your customers’ country
  • Nothing in the stack asks for a WhatsApp password or uses a modded client

One number. One afternoon. An agent that answers at 2am.

Sources

The weekly email

New guides, first.

One short email a week: the best AI tip I found, and what happened in the ANZ startup scene. Five minutes, no fluff.

By joining, you agree to get emails from jack gpt (Jack Ryan) and to the Privacy policy and Terms. Unsubscribe any time. You must be 18 or over.