Test Your First API Call
Start with one sandbox request. Keep it small, verify the response, then move to SDKs, webhooks, and production readiness.
Before You Start
- Create an AfriRoute account.
- Create a sandbox API key in the console.
- Store the key as an environment variable on your machine or server.
- Use E.164 phone numbers, for example
+251900000000.
Do not paste real API keys into docs, screenshots, browser code, or public repositories.
Send One Sandbox Message
curl --request POST https://api.afriroute.ai/api/v1/sms/send \
--header "Authorization: Bearer $AFRIROUTE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"to": "+251900000000",
"message": "Hello from AfriRoute",
"country": "ET",
"senderId": "AFRIROUTE"
}'
Use a sandbox key for this first call. Sandbox traffic is for validation and should not be treated as proof of live delivery.
Expected Shape
{
"messageId": "msg_01JPFZ0D4PT4X6YQ8ZZ8E1KS8R",
"status": "queued",
"channel": "sms",
"createdAt": "2026-06-01T18:20:00Z"
}
Statuses such as queued, accepted, or sent_to_carrier mean AfriRoute accepted the request. Only a delivery receipt or status lookup should be treated as confirmed delivery.
Check The Result
Use the returned message ID with the public message status endpoint:
curl --request GET https://api.afriroute.ai/api/v1/messages/msg_01JPFZ0D4PT4X6YQ8ZZ8E1KS8R \
--header "Authorization: Bearer $AFRIROUTE_API_KEY"
Common Failures
| Status | Meaning | Fix |
|---|---|---|
401 | Missing or invalid API key | Check the Authorization header and environment |
403 | Key lacks permission | Use a key scoped for the product |
400 | Invalid request | Check phone format and required fields |
429 | Rate limited | Back off and retry later |
503 | Route temporarily unavailable | Retry with exponential backoff |