eSMSAfrica
الأسعار تسجيل الدخول Get started
OTP / Verify

How to send an OTP by SMS

Add phone verification to your app with the managed eSMS Verify API. It generates the code, delivers it, handles retries and checks it - you call two endpoints.

bash
curl -X POST https://api.esmsafrica.io/v1/verify/start \
  -H "Authorization: Bearer $ESMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "to": "+254712345678", "app_id": "YOUR_APP_ID" }'

1. Start a verification

Send the code to the user. eSMS generates and delivers a one-time code to the number.

bash
curl -X POST https://api.esmsafrica.io/v1/verify/start \
  -H "Authorization: Bearer $ESMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "to": "+254712345678", "app_id": "YOUR_APP_ID" }'

2. Check the code

When the user types the code they received, verify it.

bash
curl -X POST https://api.esmsafrica.io/v1/verify/check \
  -H "Authorization: Bearer $ESMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "to": "+254712345678", "code": "123456" }'

Why use the managed API

The Verify API handles code generation, resend, expiry and rate-limiting for you, so you avoid building OTP fraud controls yourself. You can also send OTPs directly with the SMS API if you prefer full control.

FAQ

How fast do OTPs arrive?

OTPs route on priority paths to the local operators, so codes typically arrive within seconds across African markets.

Can I brand the OTP sender?

Yes - register a sender ID so the one-time password comes from a name your users recognize.

Ready to send?
Get an API key free and reach every African network.