The Sakura SMS API allows developers to integrate SMS and WhatsApp messaging directly into their applications, websites, and backend systems. Whether you need to send OTP codes, order notifications, appointment reminders, or marketing campaigns, our RESTful API provides a simple, reliable interface for programmatic messaging across all Tanzanian mobile networks.
API Overview
The Sakura SMS API is a standard REST API that accepts JSON payloads over HTTPS. All endpoints are available at:
Authentication
All API requests require authentication using an API key. Generate your API key from the Sakura SMS dashboard under Settings > API Keys.
Authorization: Bearer your_api_key_here
Content-Type: application/json
Sending a Single SMS
{
"to": "255712345678",
"message": "Hello John, your order #1234 has been confirmed. Thank you for shopping with us!",
"sender_id": "MYSHOP"
}
Response
"status": "success",
"message_id": "msg_a1b2c3d4e5",
"to": "255712345678",
"segments": 1,
"cost": 25.00,
"currency": "TZS",
"balance_remaining": 9975.00
}
Sending Bulk SMS
{
"messages": [
{
"to": "255712345678",
"message": "Hi John, enjoy 20% off this weekend!"
},
{
"to": "255754321098",
"message": "Hi Fatma, enjoy 20% off this weekend!"
}
],
"sender_id": "MYSHOP"
}
The bulk endpoint accepts up to 10,000 messages per request. For larger batches, use multiple requests or the CSV-based campaign endpoint.
Sending WhatsApp Template Messages
{
"to": "255712345678",
"template_name": "order_confirmation",
"template_language": "en",
"components": [
{
"type": "body",
"parameters": [
{"type": "text", "text": "John"},
{"type": "text", "text": "ORD-1234"},
{"type": "text", "text": "3"}
]
}
]
}
Checking Delivery Status
// Response:
{
"message_id": "msg_a1b2c3d4e5",
"status": "delivered",
"delivered_at": "2026-03-08T10:30:45Z",
"network": "Vodacom"
}
Webhook Delivery Reports
Instead of polling for delivery status, configure a webhook URL to receive real-time delivery reports. Set your webhook URL in Settings > API > Webhooks on your Sakura SMS dashboard.
{
"event": "delivery_report",
"message_id": "msg_a1b2c3d4e5",
"status": "delivered",
"to": "255712345678",
"timestamp": "2026-03-08T10:30:45Z",
"error_code": null
}
Checking Credit Balance
// Response:
{
"balance": 9975.00,
"currency": "TZS",
"credits_remaining": 399
}
Integration Examples
PHP (Laravel)
$response = Http::withToken('your_api_key')
->post('https://sms.sakuragroup.co.tz/api/v1/sms/send', [
'to' => '255712345678',
'message' => 'Your OTP is 123456',
'sender_id' => 'MYAPP'
]);
$messageId = $response->json('message_id');
Python (requests)
response = requests.post(
'https://sms.sakuragroup.co.tz/api/v1/sms/send',
json={
'to': '255712345678',
'message': 'Your OTP is 123456',
'sender_id': 'MYAPP'
},
headers={'Authorization': 'Bearer your_api_key'}
)
print(response.json())
Node.js (axios)
const response = await axios.post(
'https://sms.sakuragroup.co.tz/api/v1/sms/send',
{
to: '255712345678',
message: 'Your OTP is 123456',
sender_id: 'MYAPP'
},
{ headers: { Authorization: 'Bearer your_api_key' } }
);
Rate Limits and Error Handling
The API enforces the following rate limits:
- Single SMS: 100 requests per second
- Bulk SMS: 10 requests per second (up to 10,000 recipients each)
- WhatsApp: 80 messages per second (Meta's throughput limit)
- Balance/Status queries: 60 requests per minute
If you exceed these limits, the API returns HTTP 429 (Too Many Requests). Implement exponential backoff in your integration. For higher throughput, contact our team about enterprise rate limits.
Further Resources
- Full API reference in your Sakura SMS dashboard under API > Documentation
- Meta WhatsApp Cloud API documentation
- Beem Africa API docs for comparison with local alternatives
- Sakura SMS knowledge base for guides on all features