SMS API
An SMS API and gateway built for Malawi numbers
One authenticated HTTPS request sends a message to a +265 number and returns its id, parts and cost. Start with a free test key, then switch to a live key when you are ready.
One request to send
Plain HTTPS and JSON from any language, with your API key in the Authorization header. The response gives you an id to follow the message, how many parts it used and which encoding it needed.
Keep your key on your server, never in a web page or a phone app.
Examples in Node.js, Python and PHPPOST https://api.smsyanu.com/v1/messages/send
Authorization: Bearer yanu_live_YOUR_KEY
Content-Type: application/json
{
"to": "+265990000000",
"text": "Your order 1042 is ready for collection.",
"sender_id": "YANU"
}Built so a bad day does not cost you money
Test and live keys
A yanu_test_ key behaves like the real API, but nothing reaches a phone and nothing is charged.
Safe retries
Send an Idempotency-Key and a repeated request returns the first result, with no second charge.
Signed webhooks
Get a POST when a message reaches a final status, signed with HMAC-SHA256 so you can trust it.
Price before you send
POST /v1/messages/rate returns the parts and the total cost. Nothing is sent.
An SMS gateway for Malawi without the telecoms work
Sending directly to a network means contracts, connections and error codes for each operator. SMS YANU is the layer in between: your system makes one kind of request, Airtel and TNM numbers are handled the same way, and every message gets a status you can read.
Numbers are accepted the way people write them. +265888123456, 265888123456, 00265888123456 and 0888123456 all work, so you do not need to clean them first. See the guide to Malawi phone numbers for the details.
Errors have one JSON shape with a short code you can test for, such as destination_not_allowed or insufficient_balance. If the gateway refuses a message, or its final report says it failed, the charge goes back to your balance.
The main endpoints
| Endpoint | What it does | Docs |
|---|---|---|
POST /v1/messages/send | Send one SMS | Read |
POST /v1/messages/send-bulk | Send to a list, now, scheduled or slowed down | Read |
POST /v1/verify/start | Send a one-time code and check it later | Read |
GET /v1/messages/{id} | Read a message and its status | Read |
GET /v1/balance | Read your balance | Read |
Getting started
- Create an account at app.smsyanu.com.
- Create a test key in the dashboard and make a request.
- Top up, request your sender ID and switch to a live key.
Coverage
The HTTP API and web dashboard send to Malawi numbers only, in the +265 format. To send to other African countries, use an SMPP bind. For sign-in codes, use the Verify API.
How to pay
- Manual top-up: pay by bank transfer or mobile money. Send the payment and its reference from your dashboard, and our staff approve it and add the credit.
- Online payment: pay with Airtel Money, TNM Mpamba and card from your account.
Billing questions: [email protected]
Questions
What is an SMS gateway?
An SMS gateway is the service that takes a message from your software and hands it to the mobile network. With SMS YANU your software talks to the gateway over HTTPS or SMPP, and you read the outcome from the API or a webhook.
Which numbers can the SMS API reach?
The HTTP API sends to Malawi numbers (+265) only, on Airtel and TNM. A number in any other country is refused with HTTP 422 and is not charged. For other African countries, use an SMPP bind.
How much does the SMS API cost?
K20 per SMS part to Malawi numbers, from a prepaid balance. Test keys are free. The response to every send tells you the parts and the cost.
Which languages can I use?
Any language that can make an HTTPS request with JSON. The documentation has examples for cURL, Node.js, Python and PHP.
How do I know a message was delivered?
Read the status with GET /v1/messages/{id}, or register a webhook and get a signed POST when the message reaches a final status.
Keep reading
Get a test key
Create an account and make your first request with nothing sent and nothing charged.