Developer guide
Send WhatsApp, SMS and RCS messages
The RapBooster Messaging API sends WhatsApp, SMS, RCS and email from your own systems: one POST per channel under /public/v1/messages with a type and its object, from an official (Meta) number, a linked WhatsApp number, the workspace's phones or a mailbox. A test key (rb_test_) runs every check without sending, bulk sends reach up to 10,000 people a call, and webhooks report statuses, replies and inbound messages.
Guide
Step by step
How do I get a key that can send?
In RapBooster open Settings › Developers › Keys, choose New API key and tick Send messages (messages:send). Add Send in bulk (messages:bulk), Check numbers (numbers:check), Read WhatsApp groups (groups:read) or Send to WhatsApp groups (groups:send) as you need them, and pick which numbers, phones and mailboxes the key may send from.
Start with a test key (rb_test_…): every check runs (scope, sender, opt-outs, the message's rules) and the answer says test: true with a message_id starting test_, but nothing is sent and no credits are spent. The playground in Settings › Developers › Messaging sends with a test key only.
How do I send a WhatsApp message?
POST to /public/v1/messages/whatsapp with to, a type and the object named after it: text, image, video, audio, document, sticker, location, contact, reaction, buttons, list, cta_url, poll or template. sender is official (a Meta number), linked (a linked WhatsApp number) or auto (your API sender rule); number_id picks one number.
Send an Idempotency-Key header so a retry never sends twice. The answer carries message_id, sender, number_id, status and cost_credits (0 for WhatsApp).
curl
curl -X POST "https://api.rapbooster.com/api/v1/public/v1/messages/whatsapp" \
-H "Authorization: Bearer rb_test_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2d9e-order-1042" \
-d '{ "to": "+919876543210", "type": "text", "text": { "body": "Hi Asha, your order has shipped." } }'What is different on official and linked numbers?
An official number follows Meta's 24-hour rule: a free-form message needs the customer to have written in the last 24 hours, otherwise the answer is 409 MESSAGES_WINDOW_CLOSED and you send an approved template instead. A linked number has no window.
Linked numbers have no buttons or lists, so they go as a numbered text (fallback: numbered_text) and a reply of 1, 2 or the option's title comes back mapped to the option; a link button goes as text with the link, and a template as its text version. Polls are linked-only. Linked sends keep the workspace's safety limits: random waits, a daily cap per number, warm-up for new numbers and auto-pause.
How do I send a template with the SDKs?
The SDKs (Node @rapbooster/sdk, PHP rapbooster/sdk, Python rapbooster) have one helper per common message, throw an error with code, status and details when the API refuses, and add an Idempotency-Key to every write.
Node, PHP and Python
// Node
const rb = createRapBooster({ key: process.env.RAPBOOSTER_KEY });
await rb.messages.sendTemplate("+919876543210", "order_update", { customer_name: "Asha" }, "en");
// PHP
$rb = new RapBooster\Client(['key' => getenv('RAPBOOSTER_KEY')]);
$rb->messages->sendTemplate('+919876543210', 'order_update', ['customer_name' => 'Asha'], 'en');
# Python
rb = RapBooster(key=os.environ["RAPBOOSTER_KEY"])
rb.messages.send_template("+919876543210", "order_update", {"customer_name": "Asha"}, "en")How do I send SMS, RCS and email?
SMS: POST /public/v1/messages/sms with type: text, sent from the workspace's phones at no cost. RCS: POST /public/v1/messages/rcs with text or a rich card from the RCS agent (charged in credits; 402 MESSAGES_INSUFFICIENT_CREDITS when short) or text from a phone (free). Email: POST /public/v1/messages/email with subject and text (or html) from a mailbox.
How do I send to many people at once?
POST /public/v1/messages/bulk with channel, the message (the single-send body without to) and up to 10,000 recipients, each with its own variables for {{name}} placeholders. send_at schedules it up to 30 days ahead. The answer is a batch: follow it with GET /public/v1/messages/batches/{id}, list its recipients, and pause, resume or cancel it. Opted-out, invalid and repeated numbers are skipped and reported.
JSON body
{
"channel": "whatsapp",
"message": { "type": "template", "template": { "name": "diwali_offer", "language": "en", "params": { "1": "{{name}}" } } },
"recipients": [{ "to": "+919876543210", "variables": { "name": "Asha" } }]
}What else can the API do?
- Upload media once with
POST /public/v1/mediaand send itsfile_id. - Check numbers are on WhatsApp with
POST /public/v1/numbers/check(up to 1,000 a call). - List your linked numbers' groups with
GET /public/v1/whatsapp/groupsand post to one. - Read a message's state with
GET /public/v1/messages/{id}, and mark an inbound message read.
Which webhooks tell me what happened?
message.status (sent, delivered, read, failed), message.reply (a button, list or poll answer), message.inbound (a customer wrote; media as a short-lived link), message.batch.completed, sender.disconnected (a linked number went offline; its sends and batches pause) and template.status (Meta approved or rejected a template). Each delivery is signed like every RapBooster webhook: see the Webhooks guide.