Skip to main content

API Overview

The Tegasms API provides a high-speed, secure integration for SMS messaging. Send single messages, manage multi-recipient bulk campaigns, and check your account balance in real time.

Base URL

All API requests use the following base URL:

https://api.tegasms.co.tz

Protocol

The Tegasms API uses HTTPS only. Standard HTTP requests are rejected. All communication is encrypted and secure.

Data format

The API uses JSON for both request bodies and response payloads. Always set the Content-Type header to application/json.

Content-Type: application/json

What you can do

  • Send single SMS, Transmit individual messages to one recipient
  • Send bulk SMS, Dispatch messages to multiple recipients in a single request
  • Check balance, Query your current SMS credit balance in real time

Authentication

All API requests require authentication using a Bearer token. Include your API key in the Authorization header:

Authorization: Bearer your_api_token_here

See Authentication for detailed instructions on generating and using your API key.

Request structure

Every API request must include:

  1. Base URL, https://api.tegasms.co.tz
  2. Endpoint path, e.g., /api/v1/send_sms/type/single
  3. HTTP method, GET or POST
  4. Headers, Authorization and Content-Type
  5. Request body (for POST), JSON payload with message details

Example:

curl -X POST https://api.tegasms.co.tz/api/v1/send_sms/type/single \
-H "Authorization: Bearer your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"from": "Tegasms",
"recipient": "25578246004",
"message": "Hello, this is a test message"
}'

Response structure

All responses are JSON objects with a status field:

{
"status": "success",
"message": "SMS sent successfully.",
"sent": 1,
"failed": 0,
"failed_numbers": []
}

Error responses include an error message:

{
"status": "error",
"message": "Unauthorized or non-existent Sender ID for the batch payload."
}

HTTP status codes

CodeMeaning
200Request successful
400Bad request (invalid parameters)
401Unauthorized (invalid or missing API key)
429Rate limit exceeded
500Server error

Rate limiting

API requests are rate limited to prevent abuse:

  • Standard accounts, 100 requests per minute
  • High-volume accounts, Contact support for higher limits

If you exceed the rate limit, the API returns a 429 error. Wait before retrying your request.

Getting started

To start using the Tegasms API:

  1. Create an account at https://sms.tegasms.co.tz
  2. Generate an API key from your dashboard (Profile > My Account > API key > Generate)
  3. Add credit to your account
  4. Read the Authentication guide
  5. Explore the SMS Endpoints reference
tip

All API requests must use HTTPS. Ensure your integration uses the secure base URL: https://api.tegasms.co.tz

See also

Docs by Docsio