Developer API
SMS API documentation
A simple REST API secured with consumer key and secret credentials. Every call is scoped to your account and wallet.
Authentication
Create a consumer key and secret in your dashboard under Developer API. The secret is shown once, so store it safely. Exchange them for an access token (valid for 60 minutes), then send it as a Bearer token. Base URL: https://calm-bass-34.convex.site/api/v1
# 1. Exchange your consumer key & secret for a token
curl -X POST https://calm-bass-34.convex.site/api/v1/auth/token \
-u "$CONSUMER_KEY:$CONSUMER_SECRET"
# => { "accessToken": "at_...", "tokenType": "Bearer", "expiresIn": 3600 }
# 2. Call any endpoint with the token
curl https://calm-bass-34.convex.site/api/v1/wallet/balance \
-H "Authorization: Bearer at_..."/sms/send
Send a single SMS to one Kenyan mobile number. The cost is taken from your wallet immediately.
- senderId is optional; leave it out to use the shared sender. It must be approved on your account.
- reference is optional (up to 100 characters) and is echoed back in status and reports.
{
"to": "254712345678",
"message": "Your OTP is 482913",
"senderId": "ACME",
"reference": "order-4821"
}{
"requestId": "k57f3...",
"status": "queued",
"to": "254712345678",
"segments": 1,
"costCents": 80,
"balanceCents": 124520,
"reference": "order-4821"
}/sms/bulk
Send one message to up to 1,000 numbers. Invalid and duplicate numbers are skipped and not charged.
- Use {{phone}} in the message to include each recipient's number.
{
"recipients": ["254712345678", "0733000111"],
"message": "Our offices close early on Friday.",
"senderId": "ACME",
"name": "Friday notice"
}{
"batchId": "jd7a2...",
"status": "processing",
"validRecipients": 2,
"invalidRecipients": 0,
"costCents": 160,
"balanceCents": 124360,
"skipped": []
}/sms/status/{requestId}
Check a message (by requestId) or a bulk send (by batchId).
{
"type": "message",
"requestId": "k57f3...",
"status": "delivered",
"refunded": false,
"reference": "order-4821",
"deliveredAt": "2026-11-23T09:41:12.000Z"
}/wallet/balance
Get your available wallet balance in KES cents.
{
"balanceCents": 124520,
"currency": "KES"
}/reports/sms?from=2026-11-01&to=2026-11-30&status=failed&limit=50
List your messages, newest first. All filters are optional; limit is 1 to 100. Pass nextCursor back as cursor for the next page.
{
"data": [
{ "requestId": "k57f3...", "to": "2547...", "status": "failed",
"source": "api", "costCents": 80, "createdAt": "..." }
],
"nextCursor": "eyJpZCI6..."
}Errors & limits
Errors return a JSON body with a code and a readable message. Each account can make 60 calls per minute across all its keys, and each key can be limited to a list of IP addresses.
- 400Invalid request, e.g. a bad phone number or missing field.
- 401Wrong key or secret, an expired token, or a disabled key.
- 402Not enough wallet balance. Nothing was sent or charged.
- 403Calling from an IP address not on the key's allowlist, or a suspended account.
- 404No message or batch with that id on your account.
- 429More than 60 calls in a minute. Wait and retry.
{
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient wallet balance. Please top up and try again."
}
}Message statuses:
Messages that fail to send are refunded to your wallet automatically.
Your customers are one SMS away.
Create a free account, top up with M-Pesa and send your first message in under five minutes.