Developers
SMS API for Zimbabwe
Send SMS to Econet, NetOne and Telecel through a REST API, with public docs, flat USD prices and delivery reports through webhooks.
Create free account
Free to create. Sending needs a top-up, and there are no free credits.
Read the API docscurl https://api.sms.ansa.co.zw/v1/messages \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Idempotency-Key: order-1042" \ -H "Content-Type: application/json" \ -d '{"to":"+263771234567", "from":"MUFAROHIGH", "text":"Your results are ready."}'import requests response = requests.post( "https://api.sms.ansa.co.zw/v1/messages", headers={ "Authorization": "Bearer YOUR_API_KEY", "Idempotency-Key": "order-1042", }, json={ "to": "+263771234567", "from": "MUFAROHIGH", "text": "Your results are ready.", }, timeout=30,)print(response.status_code, response.json())const response = await fetch("https://api.sms.ansa.co.zw/v1/messages", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Idempotency-Key": "order-1042", "Content-Type": "application/json", }, body: JSON.stringify({ to: "+263771234567", from: "MUFAROHIGH", text: "Your results are ready.", }),});console.log(response.status, await response.json());<?php$ch = curl_init("https://api.sms.ansa.co.zw/v1/messages");curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer YOUR_API_KEY", "Idempotency-Key: order-1042", "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ "to" => "+263771234567", "from" => "MUFAROHIGH", "text" => "Your results are ready.", ]),]);$body = curl_exec($ch);echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $body;import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse; public class SendMessage { public static void main(String[] args) throws Exception { String json = """ {"to":"+263771234567", "from":"MUFAROHIGH", "text":"Your results are ready."}"""; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.sms.ansa.co.zw/v1/messages")) .header("Authorization", "Bearer YOUR_API_KEY") .header("Idempotency-Key", "order-1042") .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse<String> response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.statusCode() + " " + response.body()); }}{ "id": "msg_7f3a", "status": "queued", "network": "econet", "parts": 1, "cost_usd": "0.015"}Quickstart
- 01Create an account and top up.
- 02Create an API key in the dashboard. It's shown once, so keep it safe.
- 03Send a message to your own number and check the delivery status.
What your key can do
The same key works at every stage. What it can send grows as your account is verified.
Account stageWhat the key can send
- Topped upSend to your own number only
- ID verifiedSend to any number fromANSA
- Business verifiedSend to any number from your own sender ID
Endpoints
Base URLhttps://api.sms.ansa.co.zw
MethodPathWhat it does
- POST/v1/messagesSend one message
- POST/v1/messages/otpSend a login code
- POST/v1/batchesSend to many numbers
- GET/v1/messages/{id}Get a message
- GET/v1/messagesList messages
- GET/v1/batches/{id}Get batch progress
- GET/v1/balanceGet your balance
- GET/v1/sender-idsList your sender IDs
Delivery webhooks
Register a URL and we'll send you the result for each message. Requests are signed with HMAC-SHA256 so you can check they came from us.
Statuses
- queued
- sent
- delivered
- undelivered
- rejected
{ "id": "msg_7f3a", "status": "delivered", "network": "econet", "parts": 1, "cost_usd": "0.015"}Built for real integrations
- Idempotency keys, so a retry doesn't send or charge twice
- Separate keys, with send and read permissions, that you can revoke
- A rate limit of 10 requests a second per key
- Clear error codes
- OpenAPI 3 specification
Errors
StatusCodeWhat to do
- 402insufficient_balanceTop up to keep sending.
- 403recipient_not_allowedVerify your account.
- 403sender_not_approvedThis sender ID isn't approved for your account.
- 422invalid_numberThe number isn't a valid Zimbabwean mobile number.
- 429rate_limitedSlow down and try again.
Pricing and message length
1.5c
Econet and Telecela message, in USD
1.7c
NetOnea message, in USD
- Standard characters
- 160 in one part, or 153 per part when longer.
- Emoji and some special characters
- 70 in one part, or 67 per part when longer.
- Undelivered messages
- You're charged only if the network charges for them.
Test it on your own phone
Top up, text yourself, and see the delivery report before you message a customer.
Create free accountFree to create. Sending needs a top-up, and there are no free credits.