Send SMS, check delivery and read your balance from any language that can make an HTTPS request.
Create account to get an API keyEvery request needs your secret API key in the Authorization header. Create one under Developers / API in your dashboard. Keep it on your server and never put it in a mobile app or web page.
Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Accept: application/json
Base URL: https://tumasms.com/api/v1 · Rate limit: 60 requests per minute.
Sends one message to one or many numbers. Credits are deducted immediately, and any numbers that fail are refunded automatically.
# cURL curl -X POST https://tumasms.com/api/v1/sms/send \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json" \ -d to="0712345678,0754000000" \ -d sender_id="MYBRAND" \ -d message="Habari! Your order has shipped."
// PHP (Laravel) $response = Http::withToken('YOUR_API_KEY') ->acceptJson() ->post('https://tumasms.com/api/v1/sms/send', [ 'to' => ['0712345678', '0754000000'], 'sender_id' => 'MYBRAND', 'message' => 'Habari! Your order has shipped.', ]);
// Response — 201 Created
{
"success": true,
"message": "Message accepted for delivery.",
"data": {
"campaign_id": 1024,
"status": "queued",
"recipients": 2,
"parts": 1,
"credits_used": 2,
"balance": 9998,
"invalid_numbers": []
}
}
Returns the overall status (queued, scheduled, sending, completed, partial, failed, cancelled) and the status of each number.
curl https://tumasms.com/api/v1/sms/1024 -H "Authorization: Bearer YOUR_API_KEY"
curl https://tumasms.com/api/v1/balance -H "Authorization: Bearer YOUR_API_KEY"
{ "success": true, "data": { "balance": 9998 } }
Counts the characters and SMS parts in a message without sending it.
{ "success": true, "data": { "encoding": "GSM-7", "length": 31, "parts": 1, "per_part": 160 } }
Errors return "success": false with a readable message.
| HTTP | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 403 | Account suspended |
| 422 | Validation failed: no valid numbers, sender ID not approved, or insufficient credits |
| 429 | Too many requests. Slow down and retry. |