SMS API
A straightforward SMS API for Ethiopian applications.
Send SMS from any backend with one authenticated HTTP request. SMSHub handles carrier delivery, credit accounting and message logs so you can focus on your product.
One endpoint
POST a phone number and message as JSON with a Bearer token. Responses use standard HTTP status codes and include a request ID.
Test before you spend
The /api/test endpoint runs every validation — length, number format, moderation, signature — without sending or charging.
Local by design
Ethio Telecom and Safaricom routing, Ethiopian number normalisation (09…, 07…, +251…) and ETB billing through Chapa.
curl -X POST 'https://smshub.et/api/sms' \
-H "Authorization: Bearer sk_live_your_key" \
-H 'Content-Type: application/json' \
-d '{"msisdn":"0911234567","text":"Your MyShop verification code is 482193. Use it to confirm your phone number. It expires in 5 minutes."}'<?php
$ch = curl_init('https://smshub.et/api/sms');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SMSHUB_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'msisdn' => '0911234567',
'text' => 'Your MyShop verification code is 482193. Use it to confirm your phone number. It expires in 5 minutes.',
]),
]);
$body = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status !== 200) {
error_log('SMSHub ' . $status . ': ' . ($body['message'] ?? 'unknown'));
}const res = await fetch('https://smshub.et/api/sms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SMSHUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
msisdn: '0911234567',
text: "Your MyShop verification code is 482193. Use it to confirm your phone number. It expires in 5 minutes.",
}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error_type}: ${body.message}`);
console.log(body.data.credits_remaining);import os, requests
res = requests.post(
'https://smshub.et/api/sms',
headers={'Authorization': f"Bearer {os.environ['SMSHUB_API_KEY']}"},
json={'msisdn': '0911234567', 'text': "Your MyShop verification code is 482193. Use it to confirm your phone number. It expires in 5 minutes."},
timeout=30,
)
body = res.json()
if res.status_code != 200:
raise RuntimeError(f"{body['error_type']}: {body['message']}")
print(body['data']['credits_remaining'])