Skip to main content

API documentation

Send SMS and schedule reminders from your own software, against your pre-funded wallet.

Introduction

The UjumbeWako API sends SMS from your own code: instant messages, and reminders for a date. You send a JSON request; the money comes from your wallet; the reminder goes out under the sender UJUMBEWAKO, as From <your name>: ….

  • No sender ID to register. Send from day one, before you have one of your own.
  • Consent comes first. Someone who has not agreed to hear from you gets one invitation (KES 1) and nothing else until they accept. To yourself, no invitation.
  • KES 1 per SMS, paid from a wallet you top up by M-Pesa.
  • Test keys spend nothing and send nothing.
Two things you can do: send an instant message (one person, many, or a message for each person from a template), and schedule a reminder for a date. Both use the same wallet, the same keys and the same rules about consent.

Base URL: https://ujumbewako.com/api/v1. Everything is JSON over HTTPS.

Quickstart

  1. Create a key and choose Test mode while you build. It starts with uw_test_ and is shown once. Put it in the environment as UJUMBEWAKO_API_KEY.
  2. Send your first request: a message to your own number, to see it arrive. (Your name must be verified: one M-Pesa payment does it.)
  3. Switch to a live key (uw_live_) and top up your wallet when you are ready to send for real.
Request · cURL
curl -X POST https://ujumbewako.com/api/v1/reminders \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0a4e-1b7e-4a52-9c3d-5e1d2f8a9b10" \
  -d '{
  "recipient_phone": "+254712345678",
  "message": "Reminder: your review at SmileCare Clinic is tomorrow at 9:00 AM",
  "target_date": "2026-12-15",
  "credits_kes": 3,
  "acknowledge_delivery_risk": false
}'
Response · 201 Created
{
  "id": 1042,
  "status": "pending_acceptance",
  "livemode": true,
  "recipient_phone": "+254712345678",
  "target_date": "2026-12-15",
  "invitation_sent": true,
  "credits_spent": 3,
  "wallet_balance_kes": 47,
  "sms_scheduled": 2,
  "warnings": []
}

Authentication

Send your key on every request as a bearer token:

Header
Authorization: Bearer uw_live_…

A key acts as the account that made it and can be revoked at any time. Keep it on your server: anyone who has it can spend your wallet. Give each key only what it needs (read-only, expiry, allowed addresses, a daily cap).

Conventions

  • JSON in and out. Send Content-Type: application/json. Every error has the same shape (see Errors).
  • Idempotency. Requests that create things need an Idempotency-Key header (1 to 64 letters, digits and - _ : .). If a request times out, send it again with the same key: you get the first response back and are charged once. A response is remembered for 24 hours. Use a new key for each reminder you mean to create.
  • Times are ISO 8601 in UTC. Send hours are Nairobi time.
  • Money is whole Kenyan shillings (_kes).

Send a message

POST /api/v1/sends

An instant message: one SMS, sent now, under your name (From Wanjiru: …), to one person or to many. It costs KES 1 each. Someone who has not agreed to hear from you yet gets one invitation first (KES 1 more, no message text) and their message waits for their answer; it is refunded if they decline or do not answer in 48 hours. People who already agreed get the message at the next permitted time (not between 21:00 and 06:00, Nairobi time). Someone who stopped messages, or blocked you, is left out and not charged.

Messages go out under your verified name, not your brand, and only to people who agree to hear from you. It is not for one-time codes to people who have never heard of UjumbeWako.

Body

Fields of the request body
Field Type Description
message string The same text for everyone, up to 160 characters with your name in front (From <name>: ). Send message or template, not both.
template string A text with {blanks} for a message for each person. Send template or message, not both.
recipients required array Up to 200 people (2,000 for an organization). With message: numbers, or objects with a phone. With template: objects with a phone and its values.
max_credits_kes integer The most you will spend. A send that would cost more is refused, never trimmed.
Request · cURL
curl -X POST https://ujumbewako.com/api/v1/sends \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0a4e-1b7e-4a52-9c3d-5e1d2f8a9b10" \
  -d '{
  "message": "Our meeting is moved to 3pm. Please come on time.",
  "recipients": [
    "+254712345678",
    "+254722000111",
    "+254733000222"
  ],
  "max_credits_kes": 6
}'

Response

201. The total is charged once, before anything is made; the messages are then made in the background.

Response · 201 Created
{
  "id": 31,
  "kind": "standard",
  "status": "processing",
  "livemode": true,
  "people": 3,
  "messages": 3,
  "invitations": 2,
  "credits_spent": 5,
  "total_kes": 5,
  "wallet_balance_kes": 45,
  "sample": "From Wanjiru: Our meeting is moved to 3pm. Please come on time.",
  "left_out": []
}
Fields of the response
Field Type Description
id integer The send's id. A test key gives a test_ id.
kind string standard or personalised.
status string processing while the messages are being made; done or failed after (see Retrieve a send).
people integer How many recipients you gave.
messages integer Messages that will be made, at KES 1 each.
invitations integer People who have not agreed to hear from you yet: each gets one invitation (KES 1 more) and their message waits for their answer.
credits_spent integer KES charged now, once, before anything is made.
wallet_balance_kes integer What is left in the wallet.
sample string The first finished message, with your name in front.
left_out array Recipients who will not be messaged, and not charged: index (in your list), recipient_phone and reason (invalid_phone, duplicate, missing_value:<blank>, suppressed, recently_declined, recently_expired, invitation_pending, instant_sender_limit, instant_recipient_limit, instant_pair_limit, sender_daily_limit, recipient_daily_limit, too_long, content_<rule>).

When the same text goes to two or more people, a person may read it before it is sent: the answer is then 202 held_for_review with a hold_id, and nothing is charged. Follow it with GET /api/v1/holds/:id.

A message for each person

POST /api/v1/sends

Send a template with {blanks} and each person's own values. Each person gets their own finished message. A blank is a name of letters, digits and underscores that starts with a letter (up to 20 characters, up to 6 different blanks); a value is plain text up to 40 characters.

Fields of a recipient with a template
Field Type Description
phone required string A Kenyan number in any common format.
values object With template: one value for every blank, by name. Plain text, 40 characters at most, one line. Extra keys are ignored.
Request · cURL
curl -X POST https://ujumbewako.com/api/v1/sends \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0a4e-1b7e-4a52-9c3d-5e1d2f8a9b10" \
  -d '{
  "template": "Hi {name}, your balance is KES {amount}. Please pay by {date}.",
  "recipients": [
    {
      "phone": "+254712345678",
      "values": {
        "name": "Wanjiru",
        "amount": "1,500",
        "date": "12 Dec"
      }
    },
    {
      "phone": "+254722000111",
      "values": {
        "name": "Otieno",
        "amount": "800",
        "date": "12 Dec"
      }
    }
  ],
  "max_credits_kes": 6
}'
Response · 201 Created
{
  "id": 32,
  "kind": "personalised",
  "status": "processing",
  "livemode": true,
  "people": 3,
  "messages": 2,
  "invitations": 1,
  "credits_spent": 3,
  "total_kes": 3,
  "wallet_balance_kes": 42,
  "sample": "From Wanjiru: Hi Wanjiru, your balance is KES 1,500. Please pay by 12 Dec.",
  "left_out": [
    {
      "index": 2,
      "recipient_phone": "123",
      "reason": "invalid_phone"
    }
  ]
}

A recipient with a bad number, a missing value or a repeated number is left out and listed in left_out; the rest go. A message that is too long for one SMS, or that breaks the content rules (links, payment requests, offers), is left out the same way. The values are read, with the template, by the content check (never the phone numbers), and are erased after the retention period.

Quote a send

POST /api/v1/sends/quote

Takes the same body as a send and says what it would do and cost, without charging, making or sending anything, and without an Idempotency-Key. A read-only key may ask. Use it to show a customer the cost and who is left out before they confirm.

Request · cURL
curl -X POST https://ujumbewako.com/api/v1/sends/quote \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "message": "Our meeting is moved to 3pm. Please come on time.",
  "recipients": [
    "+254712345678",
    "+254722000111",
    "+254733000222"
  ],
  "max_credits_kes": 6
}'
Response · 200 OK
{
  "kind": "standard",
  "people": 3,
  "messages": 2,
  "invitations": 2,
  "total_kes": 4,
  "wallet_balance_kes": 45,
  "sample": "From Wanjiru: Our meeting is moved to 3pm. Please come on time.",
  "left_out": [
    {
      "index": 2,
      "recipient_phone": "123",
      "reason": "invalid_phone"
    }
  ],
  "can_afford": true
}

Retrieve a send

GET /api/v1/sends/:id

How a send went: its status, counts by state, and each person's state. For someone who agreed, reminder_id is the message's id, which is also what webhook events carry. A person's state is accepted, waiting_for_answer, declined, expired, cancelled, left_out or pending (not made yet).

Request · cURL
curl https://ujumbewako.com/api/v1/sends/31 \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY"
Response · 200 OK
{
  "id": 31,
  "kind": "standard",
  "status": "done",
  "livemode": true,
  "message": "Our meeting is moved to 3pm. Please come on time.",
  "people": 3,
  "credits_charged": 5,
  "refunded_kes": 0,
  "created_at": "2026-12-01T09:15:00Z",
  "counts": {
    "accepted": 1,
    "waiting_for_answer": 2,
    "declined": 0,
    "expired": 0,
    "cancelled": 0,
    "left_out": 0,
    "pending": 0
  },
  "recipients": [
    {
      "recipient_phone": "+254712345678",
      "status": "accepted",
      "reminder_id": 2001,
      "reason": null
    },
    {
      "recipient_phone": "+254722000111",
      "status": "waiting_for_answer",
      "reminder_id": 2002,
      "reason": null
    }
  ]
}

Create a reminder

POST /api/v1/reminders

Schedules a reminder for a date. For yourself it is active at once; for someone else the status is pending_acceptance: they get one invitation text, and nothing else is sent until they accept. If they do not answer within 48 hours the reminders are cancelled and their cost returns to your wallet.

Body

Fields of the request body
Field Type Description
recipient_phone required string A Kenyan number in any common format. Your own number sends a reminder to yourself; anyone else's must accept an invitation first.
message required string Up to 80 characters. Characters an SMS cannot carry are removed.
target_date required string The day of the event, YYYY-MM-DD.
credits_kes required integer The most you will spend, in KES. For someone else, 1 goes to the invitation (none if they already trust you) and the rest to a daily countdown of reminders ending on the date, up to 30. Anything not needed stays in your wallet. If the plan costs more, the call is refused, never trimmed.
lead string countdown (one a day for countdown days), day_of, day_before or weekly_lead. Leave it and countdown out and the budget decides.
countdown integer 1 to 30 days, with lead: "countdown".
send_hour integer 6 to 20, in Nairobi time. Default 8.
repeat string once (default) or yearly.
acknowledge_delivery_risk boolean Send true when earlier texts to the number have failed. Credits are not refunded for a text the network accepted, even if the phone does not receive it.
Request · cURL
curl -X POST https://ujumbewako.com/api/v1/reminders \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0a4e-1b7e-4a52-9c3d-5e1d2f8a9b10" \
  -d '{
  "recipient_phone": "+254712345678",
  "message": "Reminder: your review at SmileCare Clinic is tomorrow at 9:00 AM",
  "target_date": "2026-12-15",
  "credits_kes": 3,
  "acknowledge_delivery_risk": false
}'

Response

A successful call returns 201.

Response · 201 Created
{
  "id": 1042,
  "status": "pending_acceptance",
  "livemode": true,
  "recipient_phone": "+254712345678",
  "target_date": "2026-12-15",
  "invitation_sent": true,
  "credits_spent": 3,
  "wallet_balance_kes": 47,
  "sms_scheduled": 2,
  "warnings": []
}
Fields of the response
Field Type Description
id integer The reminder's id. Test keys give ids that start with test_.
status string active for yourself or someone who trusts you; pending_acceptance while someone waits to answer an invitation.
livemode boolean false for a test key.
recipient_phone string The number, in international form.
target_date string The day of the event.
invitation_sent boolean Whether an invitation text was sent.
credits_spent integer KES charged now.
wallet_balance_kes integer What is left in the wallet.
sms_scheduled integer How many texts are planned.
warnings array For example medical_wording, when the text names a health term. Not an error.

Retrieve a reminder

GET /api/v1/reminders/:id

Returns the status, the invitation (pending, accepted, declined or expired with its deadline) and messages, a count of the reminder's texts by state. Any key can read, including a read-only one.

Request · cURL
curl https://ujumbewako.com/api/v1/reminders/1042 \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY"
Response · 200 OK
{
  "id": 1042,
  "status": "pending_acceptance",
  "livemode": true,
  "recipient_phone": "+254712345678",
  "target_date": "2026-12-15",
  "invitation": {
    "status": "pending",
    "expires_at": "2026-12-03T09:15:00Z"
  },
  "messages": {
    "scheduled": 2
  },
  "created_at": "2026-12-01T09:15:00Z"
}

Cancel a reminder

DELETE /api/v1/reminders/:id

Cancels it and returns refunded_kes, the cost of the texts not yet queued. Cancelling twice is harmless. A reminder that has finished cannot be cancelled (409 not_cancellable). Needs a read-write key.

Request · cURL
curl -X DELETE https://ujumbewako.com/api/v1/reminders/1042 \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY"
Response · 200 OK
{
  "id": 1042,
  "status": "cancelled",
  "refunded_kes": 2,
  "wallet_balance_kes": 49,
  "livemode": true
}

Send many at once

POST /api/v1/reminders/batch

Takes {"reminders": [ … ]} with up to 50 items, each like a single request, and an Idempotency-Key. Each item succeeds or fails on its own and the answer lists them. Retrying a batch with the same key creates only what is missing. A batch of n counts as n requests against the rate limit.

Request · cURL
curl -X POST https://ujumbewako.com/api/v1/reminders/batch \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0a4e-1b7e-4a52-9c3d-5e1d2f8a9b10" \
  -d '{
  "reminders": [
    {
      "recipient_phone": "+254712345678",
      "message": "Reminder: your review at SmileCare Clinic is tomorrow at 9:00 AM",
      "target_date": "2026-12-15",
      "credits_kes": 3,
      "acknowledge_delivery_risk": false
    },
    {
      "recipient_phone": "+254722000111",
      "message": "Reminder: your appointment at SmileCare Clinic is tomorrow at 9:00 AM",
      "target_date": "2026-12-15",
      "credits_kes": 3
    }
  ]
}'
Response · 200 OK
{
  "results": [
    {
      "index": 0,
      "status": 201,
      "body": {
        "id": 1042,
        "status": "pending_acceptance",
        "livemode": true,
        "recipient_phone": "+254712345678",
        "target_date": "2026-12-15",
        "invitation_sent": true,
        "credits_spent": 3,
        "wallet_balance_kes": 47,
        "sms_scheduled": 2,
        "warnings": []
      }
    },
    {
      "index": 1,
      "status": 202,
      "body": {
        "status": "held_for_review",
        "hold_id": 7,
        "message": "A person reads this text before it is sent to many people. Nothing was charged. Follow GET /api/v1/holds/7."
      }
    }
  ],
  "created": 1,
  "held": 1,
  "failed": 0
}

created, held and failed count the items. Each result's status is what a single request would have returned (201, an error status, or 202 for a held item).

Batches held for review

GET /api/v1/holds/:id

When the same text goes to two or more people, a person may read it before it is sent. Those items answer 202 with held_for_review and a hold_id; nothing is charged. Ask for the hold to follow it: held, then approved (with each item's reminder_id) or cancelled. The text itself is never returned.

Request · cURL
curl https://ujumbewako.com/api/v1/holds/7 \
  -H "Authorization: Bearer $UJUMBEWAKO_API_KEY"
Response · 200 OK
{
  "id": 7,
  "status": "approved",
  "reworded": false,
  "items": [
    {
      "index": 1,
      "status": 201,
      "reminder_id": 1043
    }
  ]
}

Webhooks: overview

Instead of asking, be told. Set an https address on the API keys page and we post a JSON event to it when something happens. Each event carries only the reminder's id: fetch it with GET /api/v1/reminders/:id for the rest. The messages a send makes are reminders too: their events carry the reminder_id that Retrieve a send lists for each person. Test keys raise no events.

POST to your address
{
  "id": "evt_5e1f0c2a9b7d41e8a3c60f12",
  "type": "reminder.accepted",
  "created_at": "2026-12-01T07:30:00Z",
  "data": {
    "reminder_id": 1042
  }
}
Fields of an event
Field Type Description
id string Unique for the event. Use it to ignore a repeat.
type string What happened (below).
created_at string When, ISO 8601 UTC.
data.reminder_id integer The reminder it is about. Empty for webhook.test.

Events

Event types
Type When
reminder.accepted The person accepted your invitation: the reminders will be sent.
reminder.declined The person declined.
reminder.expired No answer in 48 hours: the reminders were cancelled and refunded.
reminder.refused The invitation could not go out (for example the number asked not to be contacted).
message.delivered The day-of message of a reminder for someone else reached the phone.
message.failed A message did not arrive.
webhook.test Sent when you press Send a test event on the API keys page.
webhook.test
{
  "id": "evt_test_1",
  "type": "webhook.test",
  "created_at": "2026-12-01T07:30:00Z",
  "data": {}
}

Verify the signature

Anyone can post to your address; the signature is how you know it was us. Every request has UjumbeWako-Signature: t=1700000000,v1=…, where v1 is the hexadecimal HMAC-SHA256 of "<t>.<raw body>" with your signing secret (shown once when you save the address). Recompute it, compare in constant time, and reject a t more than five minutes old. Use the raw body exactly as received: parsing and re-encoding it changes the bytes.

Verify · cURL
# TIMESTAMP and SIGNATURE are the t= and v1= parts of the UjumbeWako-Signature header.
# RAW_BODY is the request body exactly as received.
printf '%s' "$TIMESTAMP.$RAW_BODY" | openssl dgst -sha256 -hmac "$UJUMBEWAKO_WEBHOOK_SECRET"
# The hex it prints must equal SIGNATURE. Reject a TIMESTAMP more than 5 minutes old.

Delivery and retries

  • Answer with any 2xx within 10 seconds. Anything else is retried, up to 8 times over about 18 hours, with growing gaps.
  • Events can arrive more than once and out of order. Use the event id to ignore repeats.
  • If 20 events in a row fail after all their retries, the address is switched off; saving it again switches it back on.
  • The address must be https and public. Addresses on private or internal networks are refused, and redirects are not followed.

Keys and test mode

Make as many as you need (up to 10 active) on the API keys page and give each only what it needs.

  • Test mode. The key starts with uw_test_. It checks and answers like a live key but sends nothing, creates nothing and spends nothing. Ids start with test_. Use it while you build.
  • Read-only. It can look at reminders but never create or cancel one.
  • Expiry. It stops working after the days you choose.
  • Allowed addresses. IP addresses or ranges (for example 203.0.113.0/24) it may be used from.
  • Daily spending cap. The most it may spend in 24 hours, so a leaked key cannot empty your wallet.

Errors

A failed request answers with a status code and one JSON shape:

Response · 402 Payment Required
{
  "error": {
    "code": "insufficient_balance",
    "message": "The balance does not cover this reminder. Top up and retry.",
    "details": {}
  }
}
Error codes
Status Code Meaning
401 unauthorized Missing, wrong or revoked key.
401 key_expired The key's expiry date has passed. Create a new key.
400 idempotency_key_required Send an Idempotency-Key header.
400 invalid_idempotency_key Use 1 to 64 letters, digits and - _ : .
402 insufficient_balance The wallet does not cover the reminder. Top up and retry.
403 sender_phone_not_verified Verify your own number first.
403 sender_name_required Messages go out under your name and you have none verified. Pay once by M-Pesa from your number.
403 sender_name_pending Your name looks like a bank, a network or an organization: a person has to approve it first.
403 organization_not_verified An organization must be verified (a work email or an approval) before it can send messages.
403 ip_not_allowed The key is limited to other addresses.
403 read_only_key A read-only key cannot create or cancel reminders.
404 not_found No such reminder on your account.
409 not_cancellable A reminder that has finished cannot be cancelled.
409 request_in_progress Another request with this key is still being processed. Retry shortly.
422 idempotency_key_reused That key was already used for a different request. Use a new key.
422 invalid_request A field is missing or the wrong type. See details.
422 invalid_phone recipient_phone is not a Kenyan number.
422 credits_too_low credits_kes is less than the plan costs (the invitation, if any, plus one KES per reminder). Raise it or ask for fewer reminders.
422 batch_too_large A batch holds at most 50 reminders.
422 nothing_to_schedule Every reminder for that date would be in the past.
422 content_not_allowed The message to someone else has a link, a payment request, a confirmation lookalike or an offer.
422 key_unavailable The key that sent a held batch was revoked before a person approved it.
422 recipient_suppressed The number has asked not to receive messages.
422 no_recipients recipients has nobody who can be messaged.
422 too_many_recipients A send holds at most 200 people (2,000 for an organization). details.max says.
422 message_too_long The message, with your name in front, does not fit one SMS (160 characters).
422 invalid_template The template has no {blanks}, too many (6 at most), a bad name or a stray brace.
422 nobody_to_send_to Nobody on the list can be messaged now. details.left_out says why for each.
422 delivery_risk_not_acknowledged Earlier texts to this number failed; send acknowledge_delivery_risk: true.
422 too_many_reminders You have reached the limit of active reminders.
429 invite_limit A daily or per-recipient invitation limit was reached.
429 key_spend_cap_reached The key's daily spending cap is reached.
429 rate_limited Too many requests. See the Retry-After header.

Limits

  • 60 requests a minute per key and 300 per account. Beyond that, 429 rate_limited with a Retry-After header.
  • A person can receive at most 3 invitations a day from everyone, and you can send 20 a day (more for a reviewed organization).
  • Someone who declined cannot be invited by you again for 30 days.
  • A batch holds at most 50 reminders.

Keep the text neutral

A reminder can show on a locked screen, and a number can change hands. Write "Reminder: your review at St. Mary's Clinic is tomorrow at 10:00 AM", not a diagnosis or a treatment. If your text names a health term, the response carries a medical_wording warning; it is not blocked, and you remain responsible for the text. A text to someone else cannot carry links, payment requests or offers.

Need help? Email [email protected].