Internal Services
SMS API Kenya - Bulk SMS Gateway for Developers
Send bulk SMS and transactional messages in Kenya with Statum's reliable SMS API. Easy integration, fast delivery, real-time delivery reports, and competitive pricing.
Looking for a reliable and user-friendly SMS Gateway API in Kenya? Statum's SMS API service sets the benchmark for fast, dependable SMS messaging, not only in Kenya but worldwide.
An SMS API allows developers to integrate SMS messaging into applications, websites, or systems, automating the sending and receiving of messages efficiently. A Bulk SMS API is designed to send large volumes of messages simultaneously, ideal for marketing campaigns, customer updates, and notifications.
https://api.statum.co.ke/api/v2/sms
SMS Gateway API Features
Statum provides a carrier-grade SMS gateway designed for developers who need reliability, speed, and transparency.
High Throughput
Send thousands of messages per second with our prioritized queuing system for OTPs and critical alerts.
Real-time DLRs
Get granular delivery reports (DLRs) from Safaricom, Airtel, and Telkom directly to your callback URL.
Unicode Support
Send messages in any language including emojis. Perfect for global applications and personalized engagement.
Secure API Keys
Authenticate using legacy-compatible Basic Auth or modern Bearer tokens for maximum security.
Use Cases
- Two-Factor Authentication (2FA)
- Alerts and Notifications
- SMS Marketing
- SMS Surveys
- Auto-Responder
- Appointment Reminders
SMS API Request
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone_number | String | Yes | Recipient phone number in international format. |
| message | String | Yes | SMS content. |
| sender_id | String | Yes | Registered sender ID. |
Implementation Example
<?php
$consumerKey = "568473daf6614cb196caeb5f8805985f";
$consumerSecret = "5a07f41de16e40e4b08b4001142a5a10";
$auth = base64_encode($consumerKey . ":" . $consumerSecret);
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.statum.co.ke/api/v2/sms',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
"phone_number" => "254721553678",
"sender_id" => "Statum",
"message" => "This is a test message through our API."
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic $auth",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
SMS Gateway API Response Format
Every SMS request sent to the Statum gateway triggers a synchronous JSON response. This provides immediate confirmation that your message has been received and queued for delivery by the network operators.
{
"status_code": 200,
"description": "Operation successful.",
"request_id": "35235f08c981474abd388755ed43a427"
}
SMS Delivery Reports & Webhooks
Stay informed about the lifecycle of your messages using SMS delivery reports (DLR). The SMS API sends real-time notifications to your configured webhook callback URL when events like carrier delivery or failures occur.
| Parameter | Type | Description | Example |
|---|---|---|---|
| request_id | String | Unique transaction reference. | 35235f08c981474abd388755ed43a427 |
| charge | Decimal | Amount charged for the SMS. | 50 |
| account_balance | Decimal | Account balance after transaction. | 950.25 |
| result_code | String | Status code of transaction. 200 = success. | 200 |
| result_desc | String | Description of transaction result. | Message delivered successfully |
Sample Callback Notification
{
"request_id": "35235f08c981474abd388755ed43a427",
"charge": 50,
"account_balance": 950.25,
"result_code": "200",
"result_desc": "Message delivered successfully"
}
Sample PHP Callback Handler
<?php
// Endpoint: /api/sms/callback
$input = file_get_contents('php://input');
$payload = json_decode($input, true);
// Log the payload for auditing
file_put_contents('sms_callback.log', print_r($payload, true), FILE_APPEND);
// Process callback
if ($payload['result_code'] === '200') {
// Mark SMS as delivered in database
echo json_encode(['status' => 'success']);
} else {
// Handle failed SMS
echo json_encode(['status' => 'failed', 'reason' => $payload['result_desc']]);
}
?>