Web Rabbit MediaDocs
Messaging

Messaging overview

Base URL, messaging keys, credits and error shapes for SMS, OTP and voice.

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

Base URL
https://api.webrabbitmedia.com/v1/messaging

Messaging 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.

FieldTypeDescription
POST /v1/messaging/smssendBulk SMS campaign.
GET /v1/messaging/status/{campaign_id}readDelivery report. Higher polling budget.
POST /v1/messaging/otpsendIssue a one-time passcode (or verify with action: "verify").
POST /v1/messaging/otp/verifyverifyCheck a code. Free.
GET /v1/messaging/balancereadMessaging wallet balance.
›The old URLs still work
Everything built against 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.

shell
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 access required for sends
Sending SMS, OTPs or voice calls needs a 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.

FieldTypeDescription
SMSper segment160 GSM characters per segment; 70 for Unicode. Cost = segments × recipients × rate.
OTPper messageBilled as a single-segment SMS. Verification is free.

Errors

Response · 402
{
  "error": "insufficient_credits",
  "message": "Not enough messaging credits. Top up your wallet."
}
FieldTypeDescription
400 invalid_requesterrorBad sender ID, empty message, or no valid recipients.
401 unauthorizederrorMissing or revoked key.
403 forbiddenerrorKey is not scoped to this workspace, product, mode or access level.
402 insufficient_creditserrorWallet balance is lower than the calculated cost.
409 idempotency_conflicterrorIdempotency-Key reused with a different body, or the first call is still in flight.
429 rate_limitederrorSame limits and headers as Payments. See Rate limits.
502 provider_errorerrorUpstream 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.
iSend a test to yourself first
Every campaign page has a "Send test" button that delivers the exact final message to your own phone, up to 5 tests a day, before you launch.