Developers
The bulk SMS API for Kenya
One API and one balance to reach Safaricom, Airtel and Telkom. Clean REST, a typed SDK, webhooks and idempotent sends, documented properly so you ship in an afternoon.
Send your first SMS in five minutes
1. Install the SDK
$ npm install @pesarails/sms2. Send a message
import { Pesarails } from "@pesarails/sms";
const sms = new Pesarails("YOUR_API_KEY");
await sms.send({
to: "254712345678",
sender: "PESARAILS",
message: "Hello from PESA RAILS",
});Prefer raw HTTP? Here is the same call with curl.
curl https://api.sms.pesarails.com/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "to": "254712345678", "sender": "PESARAILS", "text": "Hello" }'Endpoints
A small, predictable surface. No surprises.
| Method | Path | What it does |
|---|---|---|
| POST | /v1/messages | Send an SMS to one recipient |
| POST | /v1/messages/bulk | Send up to 1,000 messages in one call |
| POST | /v1/otp/send | Send an OTP or transactional message |
| GET | /v1/messages/:id | Fetch a message and its delivery events |
| GET | /v1/balance | Check your SMS credit balance |
Delivery reports
Know what landed, in real time
Register a webhook and we post every delivery event the moment a network confirms it. No polling, no guessing. Signed so you can trust the payload.
{
"event": "message.delivered",
"data": {
"id": "a1b2c3",
"to": "254712345678",
"status": "DeliveredToTerminal"
}
}Build on PESA RAILS
Grab an API key and send a test message in the next five minutes.
Get an API key