Documentation menu

PESA RAILS SMS API

One REST API to send SMS across every Kenyan network, read delivery reports, manage sender IDs and top up with M-Pesa. These docs take you from your first request to production.

The API is organised around predictable resources, uses standard HTTP verbs, and returns JSON. Every request is authenticated with a bearer API key, and every response tells you exactly what happened.

Base URL

All requests go to a single base URL over HTTPS:

text
https://api.sms.pesarails.com/v1

What you can do

  • Send a single SMS, or up to 1,000 in one bulk call.
  • Send OTPs and transactional alerts on a dedicated, compliant path.
  • Receive real-time delivery reports by webhook.
  • Schedule messages and reuse templates with variables.
  • Manage sender IDs and check your credit balance.
  • Top up your prepaid balance with M-Pesa or Paystack.

Your first request

Send an SMS with a single call. Swap in your API key and sender ID, and you are live.

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",
    "message": "Hello from PESA RAILS"
  }'
Tip

New here? The Quickstart walks you through getting a key and sending a message in about five minutes.

Next steps