Getting Started
Send your first SMS in a few minutes. This guide uses curl, but every step maps directly onto the Python, TypeScript, and Go SDKs.
1. Create an API key
In the SendAfrica dashboard, open Developer → API Keys, create a key, and copy it immediately. The full key is shown only once.
Store it as SENDAFRICA_API_KEY in your deployment secret store. Never commit it, place it in a frontend bundle, or paste it into a public issue.
2. Send a message
curl -X POST https://api.sendafrica.online/v1/sms/ \
-H "X-API-Key: $SENDAFRICA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"0712345678","message":"Your order is confirmed."}'Tanzania local numbers are normalized automatically to +255. See Sending SMS for accepted formats and billing details.
3. Read the response
{
"success": true,
"data": {
"message_id": "f3b1c2d4-9e8a-4f2b-b1c2-d3e4f5a6b7c8",
"status": "Success",
"credits_used": 1
},
"request_id": "dfffa252-4781-43ff-8e1a-bf01a754d66a"
}Success means the message was accepted for delivery by the upstream route. It is not handset delivery confirmation — see Delivery Status and Webhooks for the full picture.
4. Check your balance
curl https://api.sendafrica.online/v1/credits/balance \
-H "X-API-Key: $SENDAFRICA_API_KEY"Use an SDK instead
Skip curl on your production stack:
- Python SDK —
pip install sendafrica - TypeScript SDK —
npm install sendafrica - Go SDK —
go get github.com/SendAfrica/GO-SDK
Last updated on