SMS API Overview
The AfriRoute SMS API lets you send text messages to 54+ African countries with enterprise-grade reliability, local sender IDs, Unicode support, and real-time delivery tracking. This page is your starting point: it covers authentication, the available endpoints, message lifecycle, and how the SMS docs are organised.
๐ Quick Startโ
curl -X POST https://api.afriroute.ai/api/v1/sms/send \
-H "Authorization: Bearer $AFRIROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+251911234567",
"from": "AFRIROUTE",
"text": "Hello from AfriRoute!"
}'
๐ Authenticationโ
Every request must include your secret API key as a Bearer token:
Authorization: Bearer $AFRIROUTE_API_KEY
Keys are managed from the dashboard. Use separate keys for test and production, scope them to the minimum permissions required, and rotate them periodically. Never embed keys in client-side code.
๐ Base URLโ
All endpoints are served over HTTPS from a single base URL:
https://api.afriroute.ai
๐ก Endpointsโ
| Method | Path | Purpose | Reference |
|---|---|---|---|
POST | /v1/sms/send | Send a single message | Send SMS |
POST | /v1/sms/bulk | Send to many recipients in one call | Bulk SMS |
GET | /v1/sms/{message_id} | Retrieve delivery status | Delivery Reports |
GET | /v1/sms/sender-ids | List / manage sender IDs | Sender IDs |
๐ Message Lifecycleโ
Each message moves through a predictable set of states. Every state change can be pushed to your callback_url.
| Status | Meaning |
|---|---|
queued | Accepted by AfriRoute and waiting to be dispatched |
sent | Handed off to the mobile operator |
delivered | Confirmed delivered to the handset |
failed | Could not be delivered (see Error Codes) |
๐ Standard Responseโ
A successful send returns the message resource:
{
"message_id": "msg_abc123xyz",
"status": "queued",
"to": "+251911234567",
"from": "AFRIROUTE",
"parts": 1,
"cost": 0.05,
"currency": "ETB",
"created_at": "2026-05-28T10:30:00Z"
}
๐งฉ SDK Exampleโ
const afriroute = require('@afriroute/sdk');
const client = new afriroute.Client('$AFRIROUTE_API_KEY');
const msg = await client.sms.send({
to: '+251911234567',
from: 'AFRIROUTE',
text: 'Hello from AfriRoute!'
});
console.log(msg.message_id, msg.status);
from afriroute import Client
client = Client("$AFRIROUTE_API_KEY")
msg = client.sms.send(
to="+251911234567",
from_="AFRIROUTE",
text="Hello from AfriRoute!",
)
print(msg.message_id, msg.status)
๐ Coverageโ
54+ African countries with tier-1 carrier connections, including Ethiopia, Kenya, Nigeria, South Africa, Tanzania, Uganda, Ghana, and Rwanda. View full coverage โ
๐ก Best Practicesโ
- Use E.164 phone numbers (e.g.
+251911234567) for every recipient. - Register a sender ID for higher deliverability (90%+ vs ~60%).
- Keep messages under 160 GSM-7 characters to stay within a single part.
- Handle delivery callbacks rather than polling for accurate status.
- Validate numbers before sending to avoid wasted spend.
๐ Security & Limitsโ
- All traffic is encrypted in transit over TLS.
- Default rate limit: 100 requests/second per key.
- API keys can be scoped, restricted by IP, and rotated at any time.
๐ Related Resourcesโ
Last Updated: May 2026 ยท Need help? Contact Support โ