Transactional SMS via API | MozOut - Kenya

From your system to the customer's phone

One HTTPS request is enough. The API validates it, deducts the credits and hands the message to the operators; your system follows its status.

  1. Your system

    An order, an invoice or a booking triggers the request.

  2. Our API

    Checks the key, the number and the balance, and replies in JSON.

  3. The operators

    The message goes out with your Sender ID or with NETMSG.

  4. The customer

    Gets the SMS in Mozambique and Angola, on any phone.

The statuses of a message:

  • scheduled
  • queued
  • sending
  • sent
  • failed
  • cancelled
  • simulated

Your first SMS in minutes

Start with a Sandbox key, which validates requests without sending anything or using credits. When you are ready, switch to the Production key.

  1. Create a sandbox_ key in the API Center in My MozOut, with the sms:write permission.
  2. Send a POST /v1/sms/messages request with the number and the text.
  3. Go live with the prod_ key. The request stays the same.
  • Idempotency-Key stops duplicate SMS if a request is sent again.
  • Signed webhook tells you when each SMS is sent or fails.
  • JSON response with the status, the parts and the credits.
curl https://api.mozout.com/v1/sms/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-4521-ready" \
  -d '{"number": "+258841234567",
       "text": "Your order 4521 is ready for pickup."}'
201 CreatedSandboxAPI response
{
  "data": {
    "id": "7f3c9a2e-5b41-4d8e-9a60-2c1e8b4d7f15",
    "status": "simulated", "simulated": true,
    "to": "25884****567", "parts": 1, "encoding": "GSM",
    "credits": 0, "charged": false, "mode": "sandbox"
  }
}

38 operations, grouped by area

They all start at https://api.mozout.com, with the key in the Authorization: Bearer header. The full list, with fields and responses, is in the documentation.

  • Messages

    • POST/v1/sms/messages
    • POST/v1/sms/messages/batch
    • GET/v1/sms/messages
    • GET/v1/sms/messages/{id}
    • POST/v1/sms/messages/{id}/cancel
  • Account

    • GET/v1/sms/balance
    • GET/v1/sms/stats
    • GET/v1/sms/webhook
    • PUT/v1/sms/webhook
    • POST/v1/sms/webhook/test
  • Templates

    • GET/v1/sms/templates
    • POST/v1/sms/templates
    • GET/v1/sms/templates/{id}
    • PATCH/v1/sms/templates/{id}
    • DELETE/v1/sms/templates/{id}
  • Contacts and groups

    • GET/v1/sms/contacts
    • POST/v1/sms/contacts
    • PATCH/v1/sms/contacts/{id}
    • GET/v1/sms/groups
    • POST/v1/sms/groups
    • DELETE/v1/sms/groups/{id}
  • Senders

    • GET/v1/sms/senders
    • POST/v1/sms/senders
    • GET/v1/sms/senders/{sender}
  • Opt-outs and verification

    • GET/v1/sms/opt-outs
    • POST/v1/sms/opt-outs
    • POST/v1/sms/otp
    • POST/v1/sms/otp/{id}/verify
    • POST/v1/sms/otp/{id}/resend

Transactional SMS for every transaction

When a payment comes in, an order ships or a transfer is made, the customer gets the confirmation at once. Nobody has to remember to send it.

Sandbox or Production: click to compare

Both keys use the same address and the same operations. The difference is what happens when you send.

Key prefix
sandbox_
Is the SMS sent?
No: the request is validated and the full response comes back, with simulated: true.
Credits
None are used.
X-API-Mode header
sandbox
What it is for
Building and testing without risk.

Secure keys, rules that fit you

Each key has its own permissions and can be revoked at any time. Requests always go over HTTPS.

  • Separate permissions

    sms:read to read and sms:write to send and change.

  • IP allow list

    Optional: the key only works from the addresses you list.

  • Expiry and revocation

    30, 90 or 365 days, or no expiry. Revoke it whenever you like.

  • Safe retries

    With Idempotency-Key, a repeated request never sends twice.

  • Webhook notices

    Register an HTTPS address and get a signed notice when each SMS is sent or fails.

  • Masked numbers

    Responses show the number as 25884****567, so it stays out of your logs.

SMS prices, no bundles

SMS sent through the API use the same credit balance as the SMS Center. The tier price applies to the whole quantity you buy.

  • Up to 1,000KSh2.17per creditBase price
  • 1,001 to 5,000KSh1.95per creditSave 10%
  • 5,001 to 10,000KSh1.84per creditSave 15%
  • 10,001 to 25,000KSh1.63per creditSave 25%
  • 25,001 to 50,000KSh1.52per creditSave 30%
  • 50,001 to 100,000KSh1.30per creditSave 40%
  • Over 100,000KSh1.19per creditSave 45%

Minimum of 1,000 credits. 1 SMS of up to 160 characters = 1 credit to Mozambique and 1.2 credits to Angola. Sender ID: KSh6,500.00 per name and per country.

Messages your system sends on its own

Examples of transactional SMS by sector. The phone shows how they reach the customer.

  • Banks and transfers

    Transfer of KSh50,000 to account ***4521 completed on 13/11 at 10:42. Was it not you? Call us right away on 21 000 000.

    Send it the moment it happens.
  • E-commerce

    Order No. 8812 confirmed and paid. You will get another SMS when your order is out for delivery, with the courier's name and phone.

    After payment.
  • Insurance

    Policy AU-2231 has been renewed until 13/11/2027. The receipt and the new terms are in your e-mail. Questions? Call 21 000 000.

    On renewal.

Integration without surprises

The precautions that make a difference once SMS becomes part of your system.

Good practice

  • Keep the API key in a vault or an environment variable.
  • Always send Idempotency-Key and retry with the same value.
  • Wait for the Retry-After time when the response is 429.
  • Register a webhook to know when each SMS was sent or failed.

Common mistakes

  • Writing the prod_ key in the code or the repository.
  • Retrying without Idempotency-Key: duplicate SMS.
  • Ignoring 422 errors: they say which field is wrong.
  • Using the Production key for tests: use the Sandbox one.

F.A.Q Transactional SMS

MozOut

The most frequent questions about transactional SMS through the API

An account with SMS activated, SMS credits and an API key with the sms:write permission. You create the key in the API Center in My MozOut. To test, a Sandbox key is enough, with no credits.

The send response already includes the status: sent, queued or failed. Later, call GET /v1/sms/messages/{id} or check the history. The possible statuses are scheduled, queued, sending, sent, simulated, failed and cancelled.

Yes. Put an approved Sender ID in the sender field. You can request one through the API or in My MozOut: it costs KSh6,500.00 per name and per country, and the review takes up to 48 business hours. Without sender, the free NETMSG is used.

No. Named senders, including NETMSG, cannot receive replies. If you need customers to contact you, include a phone number, an email or your website address in the message.

Any language that can make HTTPS requests: PHP, Python, JavaScript, Java, C# and more. The documentation has examples in cURL, PHP, Python and JavaScript, plus a Playground to try things out.

It is a value of your choice that you send in the request header. If the connection drops and your system repeats the same request with the same value, the API returns the first response and the SMS is not sent twice.

Up to 90 requests per minute per key and 300 per account, across all keys. The X-RateLimit-Limit and X-RateLimit-Remaining headers show how many are left. If you go over, the API answers 429 with the time to wait.

They come out of the same credit balance as the SMS Center. Each SMS part uses 1 credit to Mozambique and 1.2 credits to Angola: up to 160 characters is one part, or up to 70 with letters such as ã or ç. For a scheduled send, credits are only taken when the message goes out.

Lightning OFFER

Web Hosting + FREE Domain **

:
:
:
Stay Online!
keyboard_arrow_up Drag Up
Logo MozOut

Premium OFFER

Web Hosting + FREE Domain **

Offer ends in:
:
:
:
Stay Online!
Close