SMS API
Send one SMS
POST /v1/sms/| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient phone number |
message | string | Yes | SMS text |
from | string | No | Registered sender ID; defaults when omitted |
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 verification code is 4921."}'Response
{
"success": true,
"data": {
"message_id": "msg_demo_123",
"status": "Success",
"credits_used": 1
},
"request_id": "dfffa252-4781-43ff-8e1a-bf01a754d66a"
}Provider submission success is not handset delivery. Use webhooks for asynchronous delivery events.
Send bulk SMS
Send one message to many recipients in a single call. Partial failures return 200 with per-recipient results; only whole-request problems are error statuses.
POST /v1/sms/bulk| Field | Type | Required | Description |
|---|---|---|---|
to | array of strings | Yes | Recipient phone numbers. Maximum 1000 per call; use a campaign for larger audiences. |
message | string | Yes | SMS text |
from | string | No | Registered sender ID; defaults when omitted |
curl -X POST https://api.sendafrica.online/v1/sms/bulk \
-H "X-API-Key: $SENDAFRICA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["0712345678","0712345679"],"message":"Hello from SendAfrica!"}'Response
{
"success": true,
"data": {
"total": 2,
"sent": 2,
"failed": 0,
"results": [
{
"to": "0712345678",
"status": "sent",
"message_id": "msg_demo_123",
"credits_used": 1
},
{
"to": "0712345679",
"status": "sent",
"message_id": "msg_demo_456",
"credits_used": 1
}
]
},
"request_id": "dfffa252-4781-43ff-8e1a-bf01a754d66a"
}| Field | Type | Description |
|---|---|---|
total | int | Recipients in the batch |
sent | int | Recipients accepted by the provider |
failed | int | Recipients that failed |
results | array | Per-recipient outcome |
Per-recipient result fields — message_id and credits_used appear on success, error on failure:
| Field | Type | Description |
|---|---|---|
to | string | Recipient phone number |
status | string | sent or failed |
message_id | string | Present when sent |
credits_used | int | Present when sent |
error | string | Present on failure |
Provider submission success is not handset delivery. Use webhooks for asynchronous delivery events.
Idempotency
Pass an Idempotency-Key header (max 128 characters) to make the call safe to retry. A repeat request with the same key replays the stored whole-batch result; concurrent duplicates are rejected with 409 request_in_progress.
Other public reads
GET /v1/credits/balance
GET /v1/ratesSee phone numbers and SMS parts to avoid number-format and billing surprises.
Last updated on