The Messaging API sends bulk SMS and one-time passcodes to Ghanaian numbers. Outbound voice calling is not currently offered. It is billed from your messaging credit wallet, which is separate from your payments balance.
Base URL
https://api.webrabbitmedia.com/v1/messagingMessaging now shares the Payments host, bearer auth, error envelope, x-request-id and rate-limit headers. Sends are POST with JSON; delivery status and balance are GET.
| Field | Type | Description |
|---|---|---|
POST /v1/messaging/sms | send | Bulk SMS campaign. |
GET /v1/messaging/status/{campaign_id} | read | Delivery report. Higher polling budget. |
POST /v1/messaging/otp | send | Issue a one-time passcode (or verify with action: "verify"). |
POST /v1/messaging/otp/verify | verify | Check a code. Free. |
GET /v1/messaging/balance | read | Messaging wallet balance. |
https://webrabbitmedia.com/functions/v1/messaging-* keeps working exactly as before, with no cut-off date. The canonical routes above are what new integrations should use.Workspace and mode come from your key
A messaging API key is issued for one workspace and one mode, so business_id and mode are optional in the body — we read them off the key. Send them anyway if you prefer explicit payloads; if what you send disagrees with the key we reject the call with 403 forbidden (wrong workspace) or 400 mode_mismatch rather than guessing. Dashboard sessions still pass both.
Idempotency
SMS, OTP and voice accept the same Idempotency-Key header as Payments. A retry with the same key and body returns the original result instead of sending again; the same key with a different body returns 409 idempotency_conflict. See Idempotency.
Authentication
Create a messaging key under Messaging → Developer → API Keys. Messaging keys are scoped to the messaging product — a payments key returns 403 insufficient_scope, and the reverse is also true.
curl -X POST https://api.webrabbitmedia.com/v1/messaging/sms \
-H "Authorization: Bearer wr_live_..." \
-H "Content-Type: application/json" \
-d '{ "business_id": "…", "mode": "live", "sender": "WEBRABBIT", "recipients": ["0240000000"], "message": "Hello" }'write key. Read-only keys can still fetch delivery status and balances.Test mode & live mode
Pass mode as test or live. Test mode never touches the network: campaigns are recorded, the wallet is debited from your test wallet, and messages settle as delivered immediately with simulated: true in the response.
Credits & refunds
Cost is calculated before the send and debited up front, so an accepted send can never be free. If the provider rejects the batch, the campaign is marked failed and the full amount is refunded to your wallet ledger automatically.
Cancelling a queued or scheduled campaign refunds its credits. Because that moves money, cancelling through the API needs a write key in the same mode (live or test) as the campaign; read-only keys get 403 insufficient_scope.
| Field | Type | Description |
|---|---|---|
SMS | per segment | 160 GSM characters per segment; 70 for Unicode. Cost = segments × recipients × rate. |
OTP | per message | Billed as a single-segment SMS. Verification is free. |
Errors
{
"error": "insufficient_credits",
"message": "Not enough messaging credits. Top up your wallet."
}| Field | Type | Description |
|---|---|---|
400 invalid_request | error | Bad sender ID, empty message, or no valid recipients. |
401 unauthorized | error | Missing or revoked key. |
403 forbidden | error | Key is not scoped to this workspace, product, mode or access level. |
402 insufficient_credits | error | Wallet balance is lower than the calculated cost. |
409 idempotency_conflict | error | Idempotency-Key reused with a different body, or the first call is still in flight. |
429 rate_limited | error | Same limits and headers as Payments. See Rate limits. |
502 provider_error | error | Upstream network rejected the batch. Credits are refunded. |
SMS Marketing
From the dashboard (Messaging → Marketing) you can run campaigns without writing code:
- Your contacts — import consented contacts, build audiences and personalise with first name or city.
- Web Rabbit network — reach people who have paid Web Rabbit merchants, filtered by business category and city. Numbers are always masked, every campaign is reviewed before it sends, each person gets at most 2 offers a week, and every message ends with a STOP opt-out line.
- Packages — SMS bundles for your contacts and reach packages for the network. Bundle SMS is used before wallet balance.
- Templates — save messages for your contacts, the network, or both. Network messages cannot use personal fields.
