Beyond SMS, OTP and voice, the messaging API covers WhatsApp template campaigns, a do-not-contact list, network number lookup and phone verification. All four are priced per destination and charged from the same messaging credit balance, and all four are simulated in test mode.
Opt-outs
/v1/messaging/opt-outsNumbers on this list are removed from a send before it is priced, so you are never charged for them. Additions are mirrored to the network's own do-not-contact list.
| Field | Type | Description |
|---|---|---|
action | enum | list (default), add or remove. |
business_id | string | Optional on API-key calls — taken from the key. |
msisdns | string[] | Numbers to add or remove. msisdn accepts a single number. |
source | string | Where the opt-out came from, e.g. dashboard, stop_reply, support. |
curl -X POST https://api.webrabbitmedia.com/v1/messaging/opt-outs \
-H "Authorization: Bearer wr_live_..." \
-H "Content-Type: application/json" \
-d '{"action":"add","msisdns":["0240000000"],"source":"stop_reply"}'A send whose whole recipient list has opted out fails with all_recipients_opted_out. Otherwise the send response reports skipped_opt_out alongside the recipients that were charged.
Number lookup
/v1/messaging/lookupAsk the network whether a line is live and which operator holds it, before paying to message a large list. A result is reused free of charge for 30 days; failed checks are refunded automatically.
| Field | Type | Description |
|---|---|---|
action | enum | lookup (default) or history. |
msisdnsrequired | string[] | Up to 1,000 numbers per request. |
refresh | boolean | Ignore the 30-day cache and re-check every number. |
{
"ok": true,
"charged": 0.30,
"cached": 0,
"results": [
{
"msisdn": "0240000000",
"live": true,
"operator": "MTN Ghana",
"country_iso": "GH",
"ported": false,
"cost": 0.30
}
],
"credit_left": 41.70
}/v1/messaging/whatsappWhatsApp requires a template approved by Meta. Pull your approved templates, then send one as a campaign. Delivery reports arrive on the same signed message.delivered / message.failed webhooks as SMS.
| Field | Type | Description |
|---|---|---|
action | enum | templates, sync_templates, template, create_template, send, otp, campaigns or status. |
template | object | For create_template: name, body_text, category_id, language, header_text, footer_text, variables, button fields and an optional media header. Submitted to WhatsApp for approval. |
template_id | string | Approved template reference. Required for send and otp. |
recipients | string[] | Recipient numbers. group_ids adds saved contact groups. |
sample | string | Comma-separated values for the template variables, in order. |
schedule_at | string | ISO timestamp. The network holds the campaign until then. |
phone / code | string | For action=otp: the recipient and the code to deliver. |
sync_templates to pull the current list and approval state from the network.Phone verification
/v1/messaging/verifyThree methods, all with the same two-step shape. network lets the operator generate, send and check the code. flash places a missed call whose caller-ID digits are the code. whatsapp delivers the code on WhatsApp. For codes you want us to generate and send over SMS, use the OTP endpoint instead.
| Field | Type | Description |
|---|---|---|
action | enum | send (default), check or list. |
method | enum | network, flash or whatsapp. |
phonerequired | string | The number being verified. |
caller | string | Required for flash: the number the missed call comes from. |
template_id | string | Required for whatsapp. |
verification_id / code | string | For action=check. |
Codes expire after 10 minutes and allow five attempts. In test mode nothing is sent and 123456 is always accepted.
Contacts
/v1/messaging/contactsYour own address book. Contacts belong to your business alone — they are never written to, or read back from, a shared network address book, so no other business can see or import them.
| Field | Type | Description |
|---|---|---|
actionrequired | enum | list, create, import, update or delete. |
phone | string | Local (0240000000) or international format. |
first_name / last_name / email | string | Optional contact details. |
tag | string | Free-text label used to segment your audience. |
group_id | string | Add the contact to a saved group. |
contacts | object[] | For import: a list of { phone, first_name, last_name, email, tag }. |
contact_id | string | Required for update and delete. |
Reference data
/v1/messaging/referenceThe network's own country, time-zone and currency ids. Pass ?kind=country, timezone or currency, or omit it for every list. Time-zone ids are what timezone_id expects on a scheduled send.
curl "https://api.webrabbitmedia.com/v1/messaging/reference?kind=timezone" \
-H "Authorization: Bearer $WEBRABBIT_MESSAGING_KEY"