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:

Base URL: https://sms.sakuragroup.co.tz/api/v1
Key Features: Send single or bulk SMS, send WhatsApp template messages, manage contacts and groups, check delivery status, query credit balance, receive delivery reports via webhooks, and check number validity (HLR lookup).

Authentication

All API requests require authentication using an API key. Generate your API key from the Sakura SMS dashboard under Settings > API Keys.

// Include your API key in the Authorization header
Authorization: Bearer your_api_key_here
Content-Type: application/json
Security Best Practices: Never expose your API key in client-side code (JavaScript, mobile apps). Always make API calls from your backend server. Rotate your API key immediately if you suspect it has been compromised. You can generate new keys and revoke old ones from your dashboard at any time.

Sending a Single SMS

POST /api/v1/sms/send

{
  "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

POST /api/v1/sms/bulk

{
  "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

POST /api/v1/whatsapp/send

{
  "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

GET /api/v1/sms/status/msg_a1b2c3d4e5

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

// Sakura SMS sends this POST to your webhook URL:
{
  "event": "delivery_report",
  "message_id": "msg_a1b2c3d4e5",
  "status": "delivered",
  "to": "255712345678",
  "timestamp": "2026-03-08T10:30:45Z",
  "error_code": null
}

Checking Credit Balance

GET /api/v1/account/balance

// Response:
{
  "balance": 9975.00,
  "currency": "TZS",
  "credits_remaining": 399
}

Integration Examples

PHP (Laravel)

use IlluminateSupportFacadesHttp;

$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)

import 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 axios = require('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

Was this answer helpful? 0 Users Found This Useful (0 Votes)