# Sendra > Sendra (by BobWork) is a developer API for official WhatsApp Business numbers on Meta's WhatsApp Cloud API: get a number, send and receive messages, templates, signed webhooks, delivery statuses and usage. It also runs a remote MCP server, so Claude Code, Codex and Cursor can use it directly. Base URL: https://chat.bobwork.ai/api/sendra/v1 MCP server (Streamable HTTP): https://chat.bobwork.ai/api/sendra/mcp Dashboard (numbers, API keys, webhook secret, billing): https://bobwork.ai/sendra/app Human docs: https://bobwork.ai/sendra/docs Connect a number with Claude Code, step by step: https://bobwork.ai/sendra/connect.txt (page for people: https://bobwork.ai/sendra/connect) OpenAPI 3.1: https://bobwork.ai/sendra/openapi.json Full text for agents (the complete API reference and every MCP tool): https://chat.bobwork.ai/sendra/llms-full.txt ## WhatsApp API guides - [Test the WhatsApp API without a phone number](https://bobwork.ai/sendra/guides/whatsapp-api-sandbox): Test WhatsApp messages, the 24-hour rule, failed deliveries and signed webhooks with no phone, no Meta account and no real messages. - [Use your existing WhatsApp number with the API](https://bobwork.ai/sendra/guides/use-existing-whatsapp-number-with-api): Choose the right steps for a number on the Business app, regular WhatsApp or another API provider, or not on WhatsApp. See what changes before you start. - [Connect WhatsApp to Claude Code, Cursor or Codex](https://bobwork.ai/sendra/guides/whatsapp-mcp-claude-code-cursor-codex): Connect an official WhatsApp number or a free sandbox to your AI coding tool. Compare three kinds of WhatsApp MCP server and copy the setup. - [Build a reliable WhatsApp webhook](https://bobwork.ai/sendra/guides/whatsapp-webhooks): Get WhatsApp messages and status updates safely. Copy Node.js and Python signature checks, handle retries and ignore repeated events. - [WhatsApp API pricing since October 2026: what developers need to know](https://bobwork.ai/sendra/guides/whatsapp-api-pricing-october-2026): Meta now charges for replies after 1,000 free ones a month for each number. See what changed, why messages can stop, and the webhook fields to check. - [Fix WhatsApp API errors 131047, 131042, 131026 and more](https://bobwork.ai/sendra/guides/whatsapp-error-codes): What five common WhatsApp API errors mean and how to fix them. You can test four of them for free in Sendra's sandbox. - [Switch WhatsApp API provider without deleting your number](https://bobwork.ai/sendra/guides/switch-whatsapp-api-provider): Check who owns your WhatsApp account and who pays Meta, then try a new provider before you switch. See the risks of using two at once. ## Compare WhatsApp APIs - [Sendra vs Kapso: which WhatsApp API fits you?](https://bobwork.ai/sendra/compare/sendra-vs-kapso): Sendra and Kapso have the same monthly plan prices. Compare extra-message fees, sandboxes, AI tools and features, and see when Kapso is better. - [Sendra vs Twilio for WhatsApp](https://bobwork.ai/sendra/compare/twilio-whatsapp-alternative): Compare Sendra and Twilio for WhatsApp: message fees, sandboxes, existing numbers and when Twilio is the better choice. Sources included. - [Sendra vs 360dialog for developers](https://bobwork.ai/sendra/compare/360dialog-alternative): Compare Sendra and 360dialog on monthly prices, message limits, sandboxes, MCP tools and the WhatsApp Business app, with sources. - [Meta's Cloud API or Sendra: which should you use?](https://bobwork.ai/sendra/compare/meta-cloud-api-vs-sendra): Use Meta's WhatsApp Cloud API directly, or Sendra on top of it? Compare the costs, setup, webhooks and testing, and see when to go direct. - [Sendra vs YCloud](https://bobwork.ai/sendra/compare/ycloud-alternative): Compare Sendra and YCloud for developers: Meta fees, inbox tools, the WhatsApp Business app, webhooks, MCP and testing. Sources included. - [Sendra vs Infobip for WhatsApp](https://bobwork.ai/sendra/compare/infobip-whatsapp-alternative): Compare Sendra and Infobip for WhatsApp: trials, channels, the Business app, MCP tools and how long each retries failed webhooks. - [Sendra vs Vonage for WhatsApp](https://bobwork.ai/sendra/compare/vonage-whatsapp-alternative): Compare Sendra and Vonage for WhatsApp: sandboxes, webhook signatures, MCP tools, prices and other channels, with linked sources. - [Sendra vs Bird (formerly MessageBird) for WhatsApp](https://bobwork.ai/sendra/compare/bird-whatsapp-alternative): Compare Sendra and Bird, formerly MessageBird, on WhatsApp fees, the Business app, webhook retries and MCP tools, with a cost example. - [Sendra vs Gupshup for WhatsApp](https://bobwork.ai/sendra/compare/gupshup-alternative): Compare Sendra and Gupshup on pricing, channels, sandboxes and using the Business app, and what to ask before you connect a number. - [Sendra vs Zernio for WhatsApp](https://bobwork.ai/sendra/compare/zernio-alternative): Compare Sendra and Zernio for WhatsApp: account and message prices, sandboxes, the Business app, MCP tools and webhook retries. - [Sendra vs Wati for developers](https://bobwork.ai/sendra/compare/wati-api-alternative): A developer's comparison of Sendra and Wati: API access, webhooks, testing, MCP tools and the WhatsApp Business app. - [Sendra vs respond.io for developers](https://bobwork.ai/sendra/compare/respond-io-api-alternative): A developer's comparison of Sendra and respond.io: which plans include the API and webhooks, plus retries, MCP tools and testing. ## For AI agents - A person must get the number and the API key in the dashboard. The API cannot buy or connect a number, or make keys. - Read the key from an environment variable (SENDRA_API_KEY). Never write it into code, commits, logs or chat. - Free-form messages only reach someone within 24 hours of their last message to the number. To write first, send an APPROVED template. Meta code 131047 means the window is closed. - Only message people who agreed to hear from the business on WhatsApp. - Errors are JSON {"error": "..."} in plain words: show them to the person as they are. - Build and test against the sandbox first (a sk_test_ key): same API, simulated number, nothing reaches real people. - Guide the person through setup: GET https://chat.bobwork.ai/api/sendra/v1/setup (MCP: get_setup) lists what is done and the next step with its link. Tell them the next step before other work. ## Setup and payment After the number is connected there are two cards to add. Both are added by the person in the browser; the API never takes card details. 1. A card in Meta. Add a card in Meta before you go live. Without one, Meta can refuse templates, and replies stop once the free ones are used, or sooner for some businesses. Meta charges your business directly, at its own prices, and we add nothing. Templates are normally charged when delivered, including utility templates sent within 24 hours. Each number gets 1,000 free delivered replies (non-template messages) a month, then Meta charges for them. Some messages, such as replies to eligible ads, can be free. If Meta can't charge the business, the message fails with code 131042 in a message.status event (status.error_code), and the error text includes the account's own Meta billing link. Meta doesn't document the code it uses when free replies run out, so always show the error text. A new card can take 5–10 minutes to start working. 2. A card on Sendra. Then, when the plan's monthly messages run out, Sendra moves the account up one plan (Free → Pro $25/month, Pro → Platform $299/month) on that card and keeps sending, instead of answering 402. The person agrees to this when adding the card and can switch it off. curl https://chat.bobwork.ai/api/sendra/v1/setup -H "Authorization: Bearer $SENDRA_API_KEY" Answers {"done": false, "next": {"id": "meta_payment", "title": "Add a payment card in Meta", "why": "...", "status": "...", "action": {"label": "Open Meta billing", "url": "https://business.facebook.com/billing_hub/..."}}, "steps": [...]}. Step ids: number, hello (the first real chat), meta_payment, test, api_key, sendra_card, webhook (optional). ## Sandbox and production Two environments, chosen by the key. Same base URL, same endpoints, same MCP server. - Production: sk_live_... keys. Your real numbers, real WhatsApp messages, counted toward your plan. - Sandbox: sk_test_... keys (dashboard, switch to Sandbox, Create sandbox key). One simulated number (+1 202-555-0100, id sandbox_number). Free, no Meta, 1,000 messages a day, never counted toward your plan. It has its own message log, webhook URL and signing secret. In the sandbox: - Sends are checked exactly like production, then get the statuses Meta would send a few seconds later: sent, delivered, read (message.status webhooks, and in GET /messages). - WhatsApp's 24-hour rule is simulated. Free text to a phone that has not written in 24 hours answers 200 with a "warning", then turns failed with 131047, just like a real number. Send a template, or simulate the person writing first. - Templates: hello_world (language en_US, no blanks) and sandbox_order_update (en, 2 blanks) are built in. POST /templates approves yours at once (Meta reviews real ones). A wrong language answers 422 meta_code 132001; the wrong number of params answers 422 meta_code 132000. - Test numbers: +12025550101 always fails (131026, undeliverable); +12025550102 is delivered but never read. - Simulate an incoming message (opens the 24-hour window and sends message.received to your sandbox webhook): curl -X POST https://chat.bobwork.ai/api/sendra/v1/sandbox/inbound -H "Authorization: Bearer $SENDRA_API_KEY" -H "Content-Type: application/json" -d '{ "from": "+60123456789", "text": "Hi, is my order ready?", "name": "Aisha" }' curl -X POST https://chat.bobwork.ai/api/sendra/v1/sandbox/inbound -H "Authorization: Bearer $SENDRA_API_KEY" -H "Content-Type: application/json" -d '{ "from": "+60123456789", "button": "Yes" }' - Every webhook event has "livemode": false in the sandbox and "livemode": true in production. A sandbox key never sees production data, and the other way round. - Going live: swap SENDRA_API_KEY from the sk_test_ key to a sk_live_ key, set your production webhook, and create your templates on your real number (Meta reviews them). ## Use with Claude Code / Codex / Cursor Claude Code: claude mcp add --transport http sendra https://chat.bobwork.ai/api/sendra/mcp --header "Authorization: Bearer $SENDRA_API_KEY" Codex (~/.codex/config.toml): [mcp_servers.sendra] url = "https://chat.bobwork.ai/api/sendra/mcp" bearer_token_env_var = "SENDRA_API_KEY" Cursor (.cursor/mcp.json, or ~/.cursor/mcp.json): { "mcpServers": { "sendra": { "url": "https://chat.bobwork.ai/api/sendra/mcp", "headers": { "Authorization": "Bearer ${env:SENDRA_API_KEY}" } } } } Any other MCP client: POST JSON-RPC 2.0 to https://chat.bobwork.ai/api/sendra/mcp with the header Authorization: Bearer . Start with the get_started tool. ## Authentication Every request: Authorization: Bearer sk_live_... for production, or sk_test_... for the sandbox (or the X-API-Key header). 401 = missing or wrong key. 600 requests a minute per key (429 above that). ## Endpoints Send a text (only within the 24-hour window): curl https://chat.bobwork.ai/api/sendra/v1/messages -H "Authorization: Bearer $SENDRA_API_KEY" -H "Content-Type: application/json" \ -d '{ "to": "+60123456789", "text": "Your order #4471 is ready for pickup." }' Send a template (any time, also the first message): curl https://chat.bobwork.ai/api/sendra/v1/messages -H "Authorization: Bearer $SENDRA_API_KEY" -H "Content-Type: application/json" \ -d '{ "to": "+60123456789", "template": { "name": "order_ready", "language": "en", "params": ["4471"] } }' Send media (image, video, audio, document, sticker; public https link or a Meta media id): curl https://chat.bobwork.ai/api/sendra/v1/messages -H "Authorization: Bearer $SENDRA_API_KEY" -H "Content-Type: application/json" \ -d '{ "to": "+60123456789", "image": { "url": "https://example.com/receipt.png", "caption": "Your receipt" } }' Buttons and lists use WhatsApp's own interactive shape: { "to": "...", "type": "interactive", "interactive": { ... } }. Reactions: { "to": "...", "type": "reaction", "reaction": { "message_id": "wamid...", "emoji": "👍" } }. Fields for POST /messages: to (with country code), from (your number's id or phone; leave out with one number), reply_to (msg_... or wamid...). Answer: the logged message with status "accepted"; delivery updates come by webhook and in the log. List your numbers (id, phone, waba_id, mode): curl https://chat.bobwork.ai/api/sendra/v1/numbers -H "Authorization: Bearer $SENDRA_API_KEY" Set a number's mode ("api" = webhook only, "agent" = a BobWork AI agent answers): curl -X PATCH https://chat.bobwork.ai/api/sendra/v1/numbers/NUMBER_ID -H "Authorization: Bearer $SENDRA_API_KEY" -H "Content-Type: application/json" -d '{ "mode": "api" }' Message log, newest first (filters: number, peer, direction=in|out, limit<=100, before=next_before): curl "https://chat.bobwork.ai/api/sendra/v1/messages?direction=in&limit=20" -H "Authorization: Bearer $SENDRA_API_KEY" One message: curl https://chat.bobwork.ai/api/sendra/v1/messages/msg_XXXX -H "Authorization: Bearer $SENDRA_API_KEY" Download media a customer sent (kept 30 days by WhatsApp): curl https://chat.bobwork.ai/api/sendra/v1/media/MEDIA_ID -H "Authorization: Bearer $SENDRA_API_KEY" -o file Templates (list; create for Meta's review, usually minutes; categories UTILITY, MARKETING, AUTHENTICATION): curl https://chat.bobwork.ai/api/sendra/v1/templates -H "Authorization: Bearer $SENDRA_API_KEY" curl https://chat.bobwork.ai/api/sendra/v1/templates -H "Authorization: Bearer $SENDRA_API_KEY" -H "Content-Type: application/json" \ -d '{ "name": "order_ready", "category": "UTILITY", "language": "en", "body": "Hi {{1}}, order {{2}} is ready.", "examples": ["Aisyah", "#4471"] }' Usage this month against the plan: curl https://chat.bobwork.ai/api/sendra/v1/usage -H "Authorization: Bearer $SENDRA_API_KEY" Webhook (get; set; remove with "url": null; test with a ping; recent deliveries): curl https://chat.bobwork.ai/api/sendra/v1/webhook -H "Authorization: Bearer $SENDRA_API_KEY" curl -X PUT https://chat.bobwork.ai/api/sendra/v1/webhook -H "Authorization: Bearer $SENDRA_API_KEY" -H "Content-Type: application/json" -d '{ "url": "https://your-app.com/whatsapp", "events": ["message.received", "message.status"] }' curl -X POST https://chat.bobwork.ai/api/sendra/v1/webhook/test -H "Authorization: Bearer $SENDRA_API_KEY" curl "https://chat.bobwork.ai/api/sendra/v1/webhook/deliveries?limit=20" -H "Authorization: Bearer $SENDRA_API_KEY" ## Webhooks Events: message.received, message.status, number.connected, number.quality (and ping from the test). Each is a POST with JSON { "id": "evt_...", "type": "...", "livemode": true, "created_at": "...", "data": { ... } }. Answer 2xx within 10 seconds or we retry after 1 min, 5 min, 30 min, 2 h and 6 h. Use id to ignore repeats. The first PUT /webhook answers with the signing secret once ("rotate_secret": true makes a new one). Check every event: X-Sendra-Signature: t=,v1=." with the secret>. Reject t older than 5 minutes. import crypto from "node:crypto"; import express from "express"; function verify(rawBody, header, secret) { const { t, v1 } = Object.fromEntries(String(header || "").split(",").map((p) => p.split("="))); if (!/^\d+$/.test(t || "") || !/^[0-9a-f]{64}$/.test(v1 || "")) return false; if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; const want = crypto.createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest(); return crypto.timingSafeEqual(want, Buffer.from(v1, "hex")); } const app = express(); // Use the raw body: parsing it as JSON first would break the signature check. app.post("/whatsapp", express.raw({ type: "application/json" }), (req, res) => { if (!verify(req.body, req.get("X-Sendra-Signature"), process.env.SENDRA_WEBHOOK_SECRET)) return res.sendStatus(401); const event = JSON.parse(req.body.toString("utf8")); // Save event.id (skip it if you already have it), then do slow work after answering. res.sendStatus(200); }); app.listen(3000); ## Limits and errors Monthly messages by plan: Free 2,000 · Pro 100,000 · Platform 1,000,000 (sent and received both count). Numbers: Free 1, Pro 3 included, Platform 50 included. 400 a field is wrong · 401 bad key · 403 sandbox-only endpoint called with a production key · 402 this month's messages are used up and no auto-upgrade happened (the error says why: no card on Sendra, auto-upgrade off, or the card was declined) · 404 not found · 422 WhatsApp refused (meta_code has Meta's code; 131047 = send a template) · 429 too many requests (or the sandbox's 1,000 a day) · 502 WhatsApp did not answer.