# 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. ## Complete API reference Base URL: https://chat.bobwork.ai/api/sendra/v1 OpenAPI: https://bobwork.ai/sendra/openapi.json ### GET /: Get API information The API's name, version, environments and docs link. No key needed. No API key needed. Request: curl "https://chat.bobwork.ai/api/sendra/v1" Answer 200: { "name": "Sendra API", "version": 1, "environments": { "production": "sk_live_… keys", "sandbox": "sk_test_… keys" }, "docs": "https://bobwork.ai/sendra/docs" } ### POST /messages: Send a message Send text, a template, media, buttons, a list or a reaction. Outside the 24-hour window, only an approved template can be delivered. - to (body, string, required): The recipient's phone number with country code, e.g. +60123456789. - from (body, string): Your number: its id from GET /numbers, or the phone number. Leave it out if you have one number. - type (body, string): Required for interactive and reaction. Otherwise we work it out from the field you send. If nothing matches, it's text. Values: text, template, image, video, audio, document, sticker, interactive, reaction. - text (body, string): Message text, up to 4,096 characters. {"body": "…"} also works. - preview_url (body, boolean): Text only: show a preview of the first link. Default false. - template (body, object): {"name", "language", "params"}. language defaults to en and must match the template exactly. params fills {{1}}, {{2}}… in the body, in order. For header media or button values, send WhatsApp's "components" array; it replaces params. - image (body, object): Send an image: {"url": "https://…"} (a public https link) or {"id": "…"} (a WhatsApp media id). Optional caption, cut at 1,024 characters. - video (body, object): Send a video: {"url": "https://…"} (a public https link) or {"id": "…"} (a WhatsApp media id). Optional caption, cut at 1,024 characters. - audio (body, object): Send an audio: {"url": "https://…"} (a public https link) or {"id": "…"} (a WhatsApp media id). - document (body, object): Send a document: {"url": "https://…"} (a public https link) or {"id": "…"} (a WhatsApp media id). Optional caption, cut at 1,024 characters. Optional "filename", cut at 240 characters. - sticker (body, object): Send a sticker: {"url": "https://…"} (a public https link) or {"id": "…"} (a WhatsApp media id). - interactive (body, object): Reply buttons or a list, in WhatsApp's own format. Also send "type": "interactive". - reaction (body, object): {"message_id": "wamid.…", "emoji": "👍"}. Use wa_id, not the msg_… id. An empty emoji removes the reaction. Also send "type": "reaction". - reply_to (body, string): Quote a message by its Sendra id (msg_…) or WhatsApp id (wamid.…). Text: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/messages" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "to": "+60123456789", "text": "Your order is ready." } JSON Template: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/messages" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "to": "+60123456789", "template": { "name": "order_ready", "language": "en", "params": [ "Aisyah", "4471" ] } } JSON Image: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/messages" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "to": "+60123456789", "image": { "url": "https://example.com/receipt.png", "caption": "Your receipt" } } JSON Document: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/messages" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "to": "+60123456789", "document": { "url": "https://example.com/invoice.pdf", "filename": "invoice.pdf" } } JSON Buttons: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/messages" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "to": "+60123456789", "type": "interactive", "interactive": { "type": "button", "body": { "text": "Keep your 3pm slot?" }, "action": { "buttons": [ { "type": "reply", "reply": { "id": "yes", "title": "Yes" } }, { "type": "reply", "reply": { "id": "change", "title": "Change" } } ] } } } JSON List: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/messages" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "to": "+60123456789", "type": "interactive", "interactive": { "type": "list", "body": { "text": "Choose a time" }, "action": { "button": "See times", "sections": [ { "title": "Today", "rows": [ { "id": "15", "title": "3:00pm" }, { "id": "16", "title": "4:00pm" } ] } ] } } } JSON Reaction: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/messages" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "to": "+60123456789", "type": "reaction", "reaction": { "message_id": "wamid.HBgLNjAxMjM", "emoji": "👍" } } JSON Reply: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/messages" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "to": "+60123456789", "text": "Yes, it is.", "reply_to": "msg_In7pR1" } JSON Answer 200: { "id": "msg_Yb3kQ2", "wa_id": "wamid.HBgLNjAxMjM", "direction": "out", "from": "1234567890", "to": "60123456789", "number_id": "1234567890", "type": "text", "content": { "text": "Your order is ready." }, "source": "api", "status": "accepted", "pricing_category": null, "billable": null, "error": null, "created_at": "2026-12-01T04:00:00.000Z", "updated_at": "2026-12-01T04:00:00.000Z" } - 400: A field is missing or wrong, or "from" isn't one of your numbers. - 402: The month's messages are used up and auto-upgrade didn't happen. The response includes usage. - 422: WhatsApp refused it. See meta_code, plus the failed message in message. - 429: The sandbox's 1,000 messages for today are used up. - 502: WhatsApp didn't answer or had a problem. The message may still have been sent. Note: accepted means WhatsApp took the request, not that it arrived. Follow status in message.status events or GET /messages/{id}. Note: There is no idempotency key. After a timeout, 500 or 502, check GET /messages before you send again. Even then, WhatsApp may have accepted a message whose answer we never received. Note: If a message isn't allowed outside the 24-hour window, it can be accepted first and fail later. Watch for status failed and error_code 131047. Note: Sandbox sends that would fail outside the 24-hour window also include warning. ### GET /messages: List messages Your sent and received messages, newest first. - number (query, string): Only this number's id. - peer (query, string): Only messages with this phone number. - direction (query, string): Received (in) or sent (out). Values: in, out. - source (query, string): api: normal messages. app: sent from the WhatsApp Business app. history: chats imported from the app. Leave it out for api and app. Values: api, app, history. - limit (query, integer): 1 to 100. Default 50. - before (query, string): next_before from the previous page. Received messages: curl "https://chat.bobwork.ai/api/sendra/v1/messages?direction=in&limit=20" \ -H "Authorization: Bearer $SENDRA_API_KEY" Next page: curl "https://chat.bobwork.ai/api/sendra/v1/messages?limit=20&before=1042" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "data": [ { "id": "msg_In7pR1", "wa_id": "wamid.HBgLNjAxOTk", "direction": "in", "from": "60123456789", "to": "1234567890", "number_id": "1234567890", "type": "text", "content": { "text": { "body": "Is it ready?" } }, "source": "api", "status": "received", "pricing_category": null, "billable": null, "error": null, "created_at": "2026-12-01T04:00:00.000Z", "updated_at": "2026-12-01T04:00:00.000Z" } ], "next_before": "1042" } Note: When next_before is null, there are no more pages. Note: Pages follow the order messages were saved. For imported chats, use created_at for when they were sent. Note: Messages sent in the Business app and imported chats don't count towards your plan. Note: A before value that isn't a positive whole number returns 200 with empty data and an error field. ### GET /messages/{id}: Get a message One message and its latest status: accepted, sent, delivered, read, failed or received. We pass on WhatsApp's status, so allow for new values. - id (path, string, required): The Sendra message id (msg_…). Request: curl "https://chat.bobwork.ai/api/sendra/v1/messages/msg_Yb3kQ2" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "id": "msg_Yb3kQ2", "wa_id": "wamid.HBgLNjAxMjM", "direction": "out", "from": "1234567890", "to": "60123456789", "number_id": "1234567890", "type": "template", "content": { "template": { "name": "order_ready", "language": "en" } }, "source": "api", "status": "delivered", "pricing_category": "utility", "billable": true, "error": null, "created_at": "2026-12-01T04:00:00.000Z", "updated_at": "2026-12-01T04:00:00.000Z" } - 404: No message with this id in this environment. ### GET /media/{id}: Download media Download a file a customer sent you. The response is the file itself, with its own Content-Type. The media id is inside the received message's content, e.g. content.image.id. - id (path, string, required): The WhatsApp media id. - from (query, string): Your number: its id from GET /numbers, or the phone number. Leave it out if you have one number. Request: curl "https://chat.bobwork.ai/api/sendra/v1/media/987654321" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -o file Answer 200: the file. - 400: Choose one of your numbers with from. - 404: The file isn't available. WhatsApp keeps media for 30 days. The sandbox has no media. - 502: We couldn't download the file from WhatsApp. - 504: WhatsApp took too long to send the file. Note: If you have more than one number, send from with the number that received the file. ### GET /contacts: List contacts Contacts Meta synced from your WhatsApp Business app numbers. Other numbers and the sandbox have none. - number (query, string): Only this number's id. - limit (query, integer): 1 to 100. Default 50. - after (query, string): next_after from the previous page. Request: curl "https://chat.bobwork.ai/api/sendra/v1/contacts?limit=50" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "data": [ { "phone": "60123456789", "name": "Aisyah", "number_id": "1234567890" } ], "next_after": null } Note: phone has digits only. It can be a WhatsApp user id when there is no phone number, and name can be null. Note: When next_after is null, there are no more pages. ### GET /templates: List templates Up to 100 templates on the number's WhatsApp account, with their review status and any reason Meta gave for rejecting them. - from (query, string): Your number: its id from GET /numbers, or the phone number. Leave it out if you have one number. Request: curl "https://chat.bobwork.ai/api/sendra/v1/templates" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "data": [ { "id": "123456", "name": "order_ready", "status": "APPROVED", "category": "UTILITY", "language": "en", "components": [ { "type": "BODY", "text": "Hi {{1}}, order {{2}} is ready.", "example": { "body_text": [ [ "Aisyah", "4471" ] ] } } ] } ] } - 400: Choose one of your numbers with from. - 502: We couldn't read the templates from WhatsApp. Note: This returns at most 100 templates, with no next page. ### POST /templates: Create a template Send a new template to Meta for review, usually done within minutes. The sandbox approves it straight away. - name (body, string, required): Saved in lowercase. Each run of other characters becomes one _, and any _ at the start or end is removed. "Order Ready!" becomes order_ready. - body (body, string, required): The message. Write blanks as {{1}}, {{2}}… - examples (body, array): One example for each blank, for Meta's review. Required if the body has blanks. - category (body, string): Default UTILITY. Meta may change it. Values: UTILITY, MARKETING, AUTHENTICATION. - language (body, string): A WhatsApp language code such as en, en_US or ms. Default en. - header_text (body, string): Optional header. Cut at 60 characters. - footer (body, string): Optional footer. Cut at 60 characters. - buttons (body, array): Up to 10: {"type": "quick_reply", "text"}, {"type": "url", "text", "url"} or {"type": "phone", "text", "phone"}. Text is cut at 25 characters. Meta has more rules on mixing them. - from (body, string): Your number: its id from GET /numbers, or the phone number. Leave it out if you have one number. Request: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/templates" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "name": "order_ready", "category": "UTILITY", "language": "en", "body": "Hi {{1}}, order {{2}} is ready for pickup.", "examples": [ "Aisyah", "4471" ], "buttons": [ { "type": "url", "text": "Track order", "url": "https://example.com/orders" } ] } JSON Answer 200: { "id": "123456", "name": "order_ready", "status": "PENDING", "category": "UTILITY" } - 400: name, body or an example is missing, or "from" isn't one of your numbers. - 422: Meta didn't accept the template, or couldn't be reached. The error says why when Meta tells us. Note: Sandbox responses also include note. The sandbox keeps up to 100 templates and checks language codes. ### GET /numbers: List numbers Your connected WhatsApp numbers. Request: curl "https://chat.bobwork.ai/api/sendra/v1/numbers" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "data": [ { "id": "1234567890", "phone": "+60 12-345 6789", "waba_id": "2345678901", "mode": "api", "connected_at": "2026-12-01T04:00:00.000Z" } ] } Note: Connect numbers in the dashboard. The API can't buy or connect them. Note: A number on the WhatsApp Business app can stay there while you use the API. Note: The sandbox number also has sandbox: true, and its connected_at is null. ### PATCH /numbers/{id}: Choose who answers api: your app handles incoming messages. agent: a linked BobWork AI agent replies. You still get webhook events in both modes. - id (path, string, required): The number's id from GET /numbers. - mode (body, string, required): Who answers. Values: api, agent. Request: curl -X PATCH "https://chat.bobwork.ai/api/sendra/v1/numbers/1234567890" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "mode": "api" } JSON Answer 200: { "ok": true } - 400: The mode is wrong, the number wasn't found, or it has no linked agent. Some responses also include ok: false. Note: Numbers connected in Sendra are API only. Only a number connected from a BobWork Chat agent can use agent. ### GET /webhook: Get your webhook Where your events are sent. The signing secret is never included. Request: curl "https://chat.bobwork.ai/api/sendra/v1/webhook" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "url": "https://your-app.com/whatsapp", "events": [ "message.received", "message.status" ], "active": true, "updated_at": "2026-12-01T04:00:00.000Z" } Note: If no webhook is set, the response is {"url": null}. ### PUT /webhook: Set or remove your webhook One webhook for each environment. Setting a new URL replaces the old one. - url (body, string|null, required): A public https address without a username or password. Send null to remove the webhook. - events (body, array): Which events to send. The default is the five main events. ping works for tests even if it isn't listed. Values: message.received, message.status, message.echo, number.connected, number.quality, ping. - rotate_secret (body, boolean): Make a new signing secret. The old one stops working right away. Set: curl -X PUT "https://chat.bobwork.ai/api/sendra/v1/webhook" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "url": "https://your-app.com/whatsapp", "events": [ "message.received", "message.status" ] } JSON New secret: curl -X PUT "https://chat.bobwork.ai/api/sendra/v1/webhook" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "url": "https://your-app.com/whatsapp", "rotate_secret": true } JSON Remove: curl -X PUT "https://chat.bobwork.ai/api/sendra/v1/webhook" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "url": null } JSON Answer 200: { "url": "https://your-app.com/whatsapp", "events": [ "message.received", "message.status" ], "secret": "whsec_…", "note": "Save this secret now: it is shown once. Check X-Sendra-Signature with it." } - 400: The URL isn't a public https address, or none of the events are valid. Note: secret and note only appear when a secret is made: the first time, or with rotate_secret. Removing the webhook returns {"url": null}. Note: If you leave out events, all five main events are turned on again, even if you chose fewer before. A webhook saved before message.echo existed doesn't get it until you choose it. ### POST /webhook/test: Test your webhook Sends a ping event now and returns what your server answered. Request: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/webhook/test" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "ok": true, "id": "evt_7Hk2pQ", "status": "delivered", "http_status": 200, "error": null } Note: A failed test still returns HTTP 200, so check ok. A failed ping is retried like any other event. Note: If no webhook is set, the response is {"ok": false, "error": "…"}. ### GET /webhook/deliveries: List webhook deliveries Recent events and what happened to each one, newest first. - limit (query, integer): 1 to 200. Default 50. Request: curl "https://chat.bobwork.ai/api/sendra/v1/webhook/deliveries?limit=20" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "data": [ { "id": "evt_7Hk2pQ", "event": "message.received", "status": "delivered", "attempts": 1, "last_status": 200, "last_error": null, "created_at": "2026-12-01T04:00:00.000Z", "delivered_at": "2026-12-01T04:00:01.000Z", "next_at": "2026-12-01T04:02:00.000Z" } ] } Note: status is pending, sending, delivered or failed. next_at only matters while it is pending or sending. ### GET /usage: Get usage Messages and numbers used against your plan. Production counts by calendar month, and the sandbox by day, both in UTC. Request: curl "https://chat.bobwork.ai/api/sendra/v1/usage" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "plan": "free", "plan_name": "Free", "period": { "from": "2026-12-01T00:00:00.000Z", "to": "2027-01-01T00:00:00.000Z" }, "messages": { "sent": 120, "received": 80, "used": 200, "limit": 2000, "remaining": 1800 }, "numbers": { "connected": 1, "included": 1, "extra": 0, "extra_price_usd": null } } Note: A null limit, remaining or included means unlimited. Note: numbers.connected only counts numbers connected in Sendra. GET /numbers also lists numbers linked to your BobWork Chat agents. Note: Sent and received messages both count. Failed sends count too, once we have tried to send them. Note: Sandbox responses also include environment and note. ### GET /setup: Get setup progress What's done, what's next and a link for each step. Step ids: number, hello, meta_payment, test, api_key, sendra_card and webhook (optional). hello is done when a message you sent has reached a phone. sendra_card only appears while paid billing is on. Request: curl "https://chat.bobwork.ai/api/sendra/v1/setup" \ -H "Authorization: Bearer $SENDRA_API_KEY" Answer 200: { "done": false, "next": { "id": "meta_payment", "title": "Add a payment card in Meta", "done": false, "why": "…", "status": "No card in Meta yet.", "action": { "label": "Open Meta billing", "url": "https://business.facebook.com/billing_hub/…" } }, "steps": [ { "id": "number", "title": "Connect a WhatsApp number", "done": true, "why": "…", "status": "Connected: +60 12-345 6789" } ] } Note: next is null when every required step is done. optional, state and action only appear when they apply. Note: With a sandbox key, done is true, steps is empty, and note explains that the sandbox needs no setup. ### POST /sandbox/inbound: Simulate a customer message Sandbox keys only. Acts as if a customer wrote to you, opens their 24-hour window, and sends message.received to your sandbox webhook. - from (body, string, required): The pretend customer's phone number with country code. - text (body, string): What they wrote, up to 4,096 characters. Send text or button. - button (body, string): The title of the button they pressed, up to 20 characters. {"id", "title"} also works. If you send both, button is used instead of text. - name (body, string): Their WhatsApp name. Default: Sandbox tester. - reply_to (body, string): The sandbox message they're replying to: msg_… or wamid.… Text: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/sandbox/inbound" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "from": "+60123456789", "text": "Is my order ready?" } JSON Button: curl -X POST "https://chat.bobwork.ai/api/sendra/v1/sandbox/inbound" \ -H "Authorization: Bearer $SENDRA_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "from": "+60123456789", "button": { "id": "yes", "title": "Yes" } } JSON Answer 200: { "message": { "id": "msg_In7pR1", "wa_id": "wamid.HBgLNjAxOTk", "direction": "in", "from": "60123456789", "to": "sandbox_number", "number_id": "sandbox_number", "type": "text", "content": { "text": { "body": "Is my order ready?" } }, "source": "api", "status": "received", "pricing_category": null, "billable": null, "error": null, "created_at": "2026-12-01T04:00:00.000Z", "updated_at": "2026-12-01T04:00:00.000Z" }, "event_id": "evt_7Hk2pQ", "note": "Sent to your sandbox webhook as message.received." } - 400: The phone number, text, button or reply_to is missing or wrong. - 403: You used a production key. - 429: The sandbox's 1,000 messages for today are used up. Note: event_id is null if your sandbox webhook isn't set or doesn't include message.received. ### Errors on every endpoint - 400: A field is missing or wrong. The error says which one. - 401: The API key is missing, wrong or revoked. - 402: The plan's messages are used up and auto-upgrade didn't happen. The error says why. - 403: That feature only works with a sandbox key. - 404: The message, media or API address wasn't found. - 422: Meta refused the message or template. Failed sends include meta_code, when Meta gives one, and the failed message. - 429: Too many requests (600 a minute per key), or the sandbox's 1,000 messages a day are used up. - 500: Something went wrong on our side. Before you resend a message, check GET /messages. - 502: WhatsApp had a problem or didn't answer. A message may still have been sent, so check before you resend it. - 504: A media download took too long. Try again. Meta codes (there are others): - 131047: More than 24 hours since the customer last wrote. Send an approved template. - 131026: WhatsApp couldn't deliver it. Check the number and that the person can receive WhatsApp messages. If they haven't written in the last 24 hours, use a template. - 131042: Meta couldn't charge your business for a message. Add or fix your card using the Meta billing link in the error. Meta doesn't say which code it uses when free replies run out, so also check the error text. - 132000: The number of template values is wrong. - 132001: There's no template with that name and language. ### Webhook events message.received: A customer sent you a message. content keeps WhatsApp's format, so it depends on type. contact can be null. { "id": "evt_7Hk2pQ", "type": "message.received", "livemode": true, "created_at": "2026-12-01T04:00:00.000Z", "data": { "number": { "id": "1234567890", "phone": "+60 12-345 6789" }, "message": { "id": "msg_In7pR1", "wa_id": "wamid.HBgLNjAxOTk", "direction": "in", "from": "60123456789", "to": "1234567890", "number_id": "1234567890", "type": "text", "content": { "text": { "body": "Is it ready?" } }, "source": "api", "status": "received", "pricing_category": null, "billable": null, "error": null, "created_at": "2026-12-01T04:00:00.000Z", "updated_at": "2026-12-01T04:00:00.000Z", "contact": { "name": "Aisyah", "wa_id": "60123456789" }, "timestamp": "1796097600" } } } message.status: A message's status changed. message_id can be null if we have no matching message. Sandbox events don't include error_code. { "id": "evt_7Hk2pQ", "type": "message.status", "livemode": true, "created_at": "2026-12-01T04:00:00.000Z", "data": { "number": { "id": "1234567890", "phone": "+60 12-345 6789" }, "status": { "wa_id": "wamid.HBgLNjAxMjM", "message_id": "msg_Yb3kQ2", "status": "delivered", "recipient": "60123456789", "timestamp": "1796097605", "pricing": { "billable": true, "pricing_model": "PMP", "category": "utility" }, "error": null, "error_code": null } } } message.echo: You sent a message from the WhatsApp Business app on a connected number. { "id": "evt_7Hk2pQ", "type": "message.echo", "livemode": true, "created_at": "2026-12-01T04:00:00.000Z", "data": { "number": { "id": "1234567890", "phone": "+60 12-345 6789" }, "message": { "id": "msg_Yb3kQ2", "wa_id": "wamid.HBgLNjAxMjM", "direction": "out", "from": "1234567890", "to": "60123456789", "number_id": "1234567890", "type": "text", "content": { "text": { "body": "On my way!" } }, "source": "app", "status": "sent", "pricing_category": null, "billable": null, "error": null, "created_at": "2026-12-01T04:00:00.000Z", "updated_at": "2026-12-01T04:00:00.000Z", "timestamp": "1796097600" } } } number.connected: A number was connected in Sendra. mode is always api. { "id": "evt_7Hk2pQ", "type": "number.connected", "livemode": true, "created_at": "2026-12-01T04:00:00.000Z", "data": { "phone": "+60 12-345 6789", "mode": "api" } } number.quality: Meta changed a number's quality rating, messaging limit or status. We check about every 6 hours. Values can be null. { "id": "evt_7Hk2pQ", "type": "number.quality", "livemode": true, "created_at": "2026-12-01T04:00:00.000Z", "data": { "number": { "id": "1234567890", "phone": "+60 12-345 6789" }, "before": { "quality_rating": "GREEN", "messaging_tier": "TIER_1K", "status": "CONNECTED" }, "now": { "quality_rating": "YELLOW", "messaging_tier": "TIER_1K", "number_status": "CONNECTED", "status": "CONNECTED" } } } ping: A test from the dashboard or POST /webhook/test. { "id": "evt_7Hk2pQ", "type": "ping", "livemode": true, "created_at": "2026-12-01T04:00:00.000Z", "data": { "message": "Hello from Sendra" } } ### Check a webhook signature Node: 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); Python: import hashlib, hmac, re, time def verify(raw_body: bytes, header: str, secret: str) -> bool: parts = dict(p.split("=", 1) for p in (header or "").split(",") if "=" in p) t, v1 = parts.get("t", ""), parts.get("v1", "") if not re.fullmatch(r"[0-9]+", t) or not re.fullmatch(r"[0-9a-f]{64}", v1): return False if abs(time.time() - int(t)) > 300: return False want = hmac.new(secret.encode(), t.encode() + b"." + raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(want, v1) ## Getting started (what the get_started tool says) Sendra sends and receives WhatsApp messages from official WhatsApp Business numbers (Meta's WhatsApp Cloud API). Setup: 1. Number: a person signs in at https://bobwork.ai/sendra/app presses "Connect a number" and chooses where the number is now: the WhatsApp Business app (they keep using it), not on WhatsApp, the regular WhatsApp app, another API provider, or not sure. Each choice has its own steps (Meta sign-up in the browser). Neither the API nor these tools can buy or connect a number. Step-by-step guide to follow with the person: https://bobwork.ai/sendra/connect.txt 2. API key: made in the same dashboard (API keys). Keep it in an environment variable such as SENDRA_API_KEY. Never write it into code, commits or logs. 3. Sending: free text (send_text, send_media, send_interactive) only reaches a person within 24 hours of their last message to this number. To write first, or after 24 hours, use send_template with an APPROVED template (list_templates shows them; create_template submits a new one for Meta's review, usually minutes). Meta error 131047 means the 24-hour window is closed: send a template. 4. Receiving: set_webhook with a public https URL. Every event is a signed POST; verify the X-Sendra-Signature header (t=,v1=." with the signing secret). The secret is shown once, in the dashboard, never to these tools. 5. Limits: monthly messages by plan (Free 2,000, Pro 100,000, Platform 1,000,000; sent and received both count). Sending answers 402 when they are used up, unless the account has a card on Sendra with auto-upgrade on: then it moves up one plan and keeps sending. 600 requests a minute per key. 6. Payment, two cards: (a) 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. The card is added in Meta's Billing Hub. Error 131042 means Meta couldn't charge the business. (b) A card on Sendra lets the plan move up automatically at the message limit instead of stopping. get_setup shows both, with links. 7. Guide the person: call get_setup (get_started includes it). If a step is not done, tell the person the next step and its link in plain words before doing other work, and check again after they say it is done. A person adds cards and connects numbers themselves in the browser; these tools never take card details. 8. Sandbox: a sandbox key (sk_test_…) works the same on a simulated number, free and without Meta. Sends get Meta's statuses and error codes, the 24-hour rule included, and simulate_inbound fakes a person writing in. Switch to a production key (sk_live_…) to reach real people. Only message people who agreed to hear from the business on WhatsApp. Docs: https://bobwork.ai/sendra/docs · plain text for agents: https://chat.bobwork.ai/sendra/llms.txt With a sandbox key it adds: You are in the SANDBOX (sk_test_ key): one simulated number, nothing reaches WhatsApp or Meta, nothing is billed, 1,000 messages a day. - Sends get the statuses Meta would send (sent, delivered, read) a few seconds later, by webhook and in list_messages. - The 24-hour rule is simulated: free text to someone who has not written in 24 hours is marked failed (131047). Use simulate_inbound first, or a template. - Templates: hello_world (en_US) and sandbox_order_update (en, 2 blanks) are built in; create_template approves yours at once. - Test numbers: +1 202-555-0101 always fails (131026); +1 202-555-0102 is delivered but never read. - Webhook events carry "livemode": false. The sandbox has its own webhook URL and secret. ## MCP tools The MCP server at https://chat.bobwork.ai/api/sendra/mcp has these tools. Each one calls the same code as the matching v1 endpoint, with the same checks and the same error text (errors come back as tool results with isError true). Tool answers never include API keys, webhook secrets or Meta tokens. ### get_started Read this first. Explains Sendra's setup (getting a number, API keys), WhatsApp's 24-hour rule and when a template is needed, webhooks and limits, and shows this account's numbers, webhook and usage right now. ### get_setup This account's setup checklist from live state: number connected, first chat (a message reached a real phone), card in Meta (needed before going live), a test template, API key, card on Sendra (so the plan moves up at the limit instead of stopping), webhook. Each open step has a link. Tell the person the next open step. ### list_numbers List the account's WhatsApp numbers: id (use it as `from`), phone, WhatsApp Business Account id and mode (api = incoming messages go to your webhook only; agent = a BobWork AI agent answers). ### set_number_mode Choose who handles a number's incoming messages: "api" (your webhook only) or "agent" (a BobWork AI agent answers; only for numbers linked to an agent). - number_id (required): The number's id from list_numbers. - mode (required): api or agent One of: api, agent. ### send_text Send a WhatsApp text message. Only delivered within 24 hours of the person's last message to this number; to write first, use send_template. Returns the logged message (status "accepted"); delivery updates come by webhook and in list_messages. - to (required): Recipient's phone number with country code, e.g. +60123456789. - text (required): The message, up to 4,096 characters. - from: Your number to send from: its id from list_numbers or the phone itself. Leave out when the account has one number. - reply_to: Optional: quote an earlier message, by its Sendra id (msg_…) or WhatsApp id (wamid.…). - preview_url: Show a preview of the first link. ### send_template Send an approved WhatsApp template. Works any time, including the first message to someone and after the 24-hour window. Use list_templates for names, languages and how many {{n}} blanks each has. - to (required): Recipient's phone number with country code, e.g. +60123456789. - name (required): Template name, e.g. order_ready. - language: Template language code, e.g. en or en_US. Defaults to en. - params: Values for the body's {{1}}, {{2}}… in order. - components: Advanced: WhatsApp's own components array (header media, buttons). Overrides params. - from: Your number to send from: its id from list_numbers or the phone itself. Leave out when the account has one number. ### send_media Send a picture, video, audio, document or sticker by public https link (or a WhatsApp media id). Same 24-hour rule as send_text. - to (required): Recipient's phone number with country code, e.g. +60123456789. - type (required): Kind of media. One of: image, video, audio, document, sticker. - url: Public https link to the file. - media_id: Or a WhatsApp media id instead of url. - caption: Caption (not for audio or sticker). - filename: File name shown for a document. - from: Your number to send from: its id from list_numbers or the phone itself. Leave out when the account has one number. - reply_to: Optional: quote an earlier message, by its Sendra id (msg_…) or WhatsApp id (wamid.…). ### send_interactive Send reply buttons or a list, in WhatsApp's own `interactive` shape, e.g. {"type":"button","body":{"text":"Keep your 3pm slot?"},"action":{"buttons":[{"type":"reply","reply":{"id":"yes","title":"Yes"}}]}}. Same 24-hour rule as send_text. - to (required): Recipient's phone number with country code, e.g. +60123456789. - interactive (required): WhatsApp's interactive object (type button or list, body, action). - from: Your number to send from: its id from list_numbers or the phone itself. Leave out when the account has one number. - reply_to: Optional: quote an earlier message, by its Sendra id (msg_…) or WhatsApp id (wamid.…). ### send_reaction React to a message with an emoji (an empty emoji removes the reaction). - to (required): Recipient's phone number with country code, e.g. +60123456789. - message_id (required): The WhatsApp id (wa_id, wamid.…) of the message, from list_messages. - emoji (required): One emoji, e.g. 👍. - from: Your number to send from: its id from list_numbers or the phone itself. Leave out when the account has one number. ### list_messages The message log, newest first, sent and received, with delivery status (accepted, sent, delivered, read, failed) and Meta's pricing category. For the next page pass `before` = next_before from the previous answer. - number: Only this number (its id). - peer: Only messages with this phone number. - direction: in or out One of: in, out. - limit: Up to 100, default 50. - before: next_before from the previous page. ### get_message One message by its Sendra id (msg_…) with its latest status. - id (required): Sendra message id, msg_… ### list_templates The WhatsApp templates of a number's business account, with review status (APPROVED, PENDING, REJECTED), category, language and components. - from: Your number to send from: its id from list_numbers or the phone itself. Leave out when the account has one number. ### create_template Submit a new template for Meta's review (usually minutes). Body blanks are {{1}}, {{2}}…; give one example per blank. - name (required): Lowercase with underscores, e.g. order_ready. - body (required): Body text, e.g. "Hi {{1}}, order {{2}} is ready." - examples: One example value per {{n}} blank, for Meta's review. - category: UTILITY (default), MARKETING or AUTHENTICATION. One of: UTILITY, MARKETING, AUTHENTICATION. - language: Language code, default en. - header_text: Optional header text (60 characters). - footer: Optional footer (60 characters). - buttons: Up to 10: {type: quick_reply|url|phone, text, url?, phone?}. - from: Your number to send from: its id from list_numbers or the phone itself. Leave out when the account has one number. ### get_usage This calendar month's sent and received messages against the plan's limit, and numbers connected against the plan. ### get_webhook The webhook URL and events this account's events are sent to (the signing secret is never shown here). ### set_webhook Set the public https URL that receives events (message.received, message.status, number.connected, number.quality), or pass url null to remove it. The signing secret is not returned to tools: the person views it in the dashboard (Make a new secret). - url (required): Public https URL, or null to remove the webhook. - events: Which events to send. Default: all four. ### test_webhook Send a ping event to the webhook now and report what the endpoint answered. ### simulate_inbound Sandbox only: pretend a person sent a WhatsApp message (text, or a press of one of your buttons) to the sandbox number. It is logged, sent to the sandbox webhook as message.received, and opens the 24-hour window with that person. - from (required): The sender's phone number with country code, e.g. +60123456789. - text: What they wrote. - button: Or: the title of the reply button they pressed. - name: Their WhatsApp profile name (optional). - reply_to: Optional: the msg_… id of your message they are replying to. ### list_webhook_deliveries The latest webhook deliveries with their result, HTTP status and number of tries. - limit: Default 50.