// developers

One API. Every network in Tanzania.

Send SMS, check delivery status and read your balance with a single JSON API. Free on every plan, no separate API fee.

Base URL
https://api.nasisms.co.tz/api/v1
Auth
HTTP Basic
Format
JSON
// authentication

Authenticate with your API key and secret.

Generate an API key pair from your dashboard under API Keys. Your secret is shown once at creation, so store it safely: only its hash is kept afterwards.

Combine them as api_key:api_secret and send them as HTTP Basic credentials on every request, alongside JSON headers:

  • Authorization: Basic <base64(api_key:api_secret)>
  • Content-Type: application/json on POST requests
  • Accept: application/json on every request

Revoke or delete a key any time from the same page. A revoked key is rejected immediately, and a suspended account loses API access entirely.

auth.sh
# Most HTTP libraries handle Basic Auth for you —
# curl's -u flag builds the header automatically:

curl https://api.nasisms.co.tz/api/v1/balance \
  -u "$API_KEY:$API_SECRET" \
  -H "Accept: application/json"

# => 200 OK
{
  "balance": 12750.00,
  "currency": "TZS"
}
// endpoints

Three endpoints. That's the whole API.

POST/sms/send

Queue an SMS to one or many recipients. Sending happens asynchronously: this call queues the campaign and returns immediately.

Parameters
FieldTypeRequiredNotes
fromstringRequiredYour Sender ID, max 20 characters. Must already be approved and in 'ready' status.
tostring or arrayRequiredOne MSISDN or an array of them, e.g. "255712345678". Duplicates are removed automatically.
textstringRequiredThe message body, max 4,000 characters.
referencestringOptionalYour own tracking ID for this send, max 100 characters.

Note: the status returned here reflects that your message has been queued, not its final delivery outcome. Poll GET /sms/logs to see when a message updates to delivered or failed. There is currently no delivery webhook.

Example response
{
  "messages": [
    {
      "to": "255712345678",
      "status": {
        "groupName": "PENDING",
        "name": "PENDING_ENROUTE",
        "description": "Message queued for sending"
      },
      "smsCount": 1
    },
    {
      "to": "255678901234",
      "status": {
        "groupName": "PENDING",
        "name": "PENDING_ENROUTE",
        "description": "Message queued for sending"
      },
      "smsCount": 1
    }
  ]
}
GET/sms/logs

Paginated history of messages sent from your account, filterable by date range and status.

Parameters
FieldTypeRequiredNotes
pageintegerOptionalPage number of results. Defaults to 1.
per_pageintegerOptionalResults per page, 1–100. Defaults to 20.
fromdateOptionalFilter to messages sent on or after this date (YYYY-MM-DD).
todateOptionalFilter to messages sent on or before this date (YYYY-MM-DD).
statusstringOptionalFilter by exact status, e.g. queued, sent, delivered, failed.
Example response
{
  "data": [
    {
      "id": 1,
      "to": "255712000001",
      "text": "message body",
      "status": "delivered",
      "segments": 1,
      "cost": 35.0,
      "provider_message_id": "abc123xyz",
      "source": "api",
      "sent_at": "2026-07-01T14:30:00+03:00"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 20,
    "total": 243,
    "last_page": 13
  }
}
GET/balance

Your current prepaid wallet balance.

Parameters

No parameters required.

Example response
{
  "balance": 12750.00,
  "currency": "TZS"
}
// code samples

Sending an SMS, in your language.

curl -X POST https://api.nasisms.co.tz/api/v1/sms/send \
  -u "$API_KEY:$API_SECRET" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "from": "NASISMS",
    "to": ["255712345678", "255678901234"],
    "text": "Karibu! Punguzo la 20% leo tu.",
    "reference": "promo-2026-07"
  }'
// errors

Errors are JSON, with a clear message.

CodeMeaningCommon cause
400Bad RequestMissing required field, invalid phone number, or an unrecognised/inactive Sender ID.
401UnauthorizedMissing or invalid API key/secret, a revoked key, or a suspended account.
402Payment RequiredYour wallet balance is too low to cover this campaign.
422Unprocessable EntityA field failed validation, e.g. text over 4,000 characters.
429Too Many RequestsYou're sending requests too quickly.
500Server ErrorAn unexpected fault on our side. Retry, or contact support if it persists.
error.json
{
  "error": {
    "code": 400,
    "message": "Sender ID \"MYBRAND\" is not found or not yet active. Status must be 'ready'."
  }
}

Get your API keys and start sending.

Create a free account, generate an API key pair, and make your first call in minutes.

Create free account