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:
- Base URL,
https://api.tegasms.co.tz - Endpoint path, e.g.,
/api/v1/send_sms/type/single - HTTP method, GET or POST
- Headers, Authorization and Content-Type
- 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
| Code | Meaning |
|---|---|
| 200 | Request successful |
| 400 | Bad request (invalid parameters) |
| 401 | Unauthorized (invalid or missing API key) |
| 429 | Rate limit exceeded |
| 500 | Server 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:
- Create an account at https://sms.tegasms.co.tz
- Generate an API key from your dashboard (Profile > My Account > API key > Generate)
- Add credit to your account
- Read the Authentication guide
- Explore the SMS Endpoints reference
All API requests must use HTTPS. Ensure your integration uses the secure base URL: https://api.tegasms.co.tz
See also
- Authentication, Generate and use API keys
- SMS Endpoints, Complete endpoint reference
- Quick start, Set up your account