Developers

SMS API documentation

Send SMS, check delivery and read your balance from any language that can make an HTTPS request.

Create account to get an API key

Authentication

Every 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.

POST/sms/send

Sends one message to one or many numbers. Credits are deducted immediately, and any numbers that fail are refunded automatically.

FieldTypeDescription
tostring | arrayTanzanian numbers, comma-separated or as an array. Accepts 07…, 2557… or +2557….
messagestringThe text to send (up to 10 SMS parts).
sender_idstringOptional. One of your approved sender IDs (case-sensitive). Defaults to your first approved ID. You need at least one approved sender ID to send.
schedule_atdatetimeOptional. e.g. 2026-12-24 08:00 (East Africa Time).
# 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": []
  }
}

GET/sms/{campaign_id}

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"

GET/balance

curl https://tumasms.com/api/v1/balance -H "Authorization: Bearer YOUR_API_KEY"

{ "success": true, "data": { "balance": 9998 } }

POST/sms/count

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

Errors return "success": false with a readable message.

HTTPMeaning
401Missing or invalid API key
403Account suspended
422Validation failed: no valid numbers, sender ID not approved, or insufficient credits
429Too many requests. Slow down and retry.