Verification

Prove it is really them, on any phone.

Send a one-time code by SMS, WhatsApp or a phone call that reads it aloud, then verify it with a second request. We generate the code, remember it, expire it and check it, so your application never stores a secret it does not need.

two requests
POST /v1/otp/send
{ "phone": "233241234567", "channel": "sms" }
→ { "status": "sent", "expires_in": 300 }
# the user types the code they received
POST /v1/otp/verify
{ "phone": "233241234567", "code": "482913" }
→ { "verified": true }

Three channels

Same code, delivered the way that works for the user.

SMS

The default. One credit per code, delivered from your sender name. Works on every phone, no app or data required.

WhatsApp

For users on data who live in WhatsApp. Sent through the official WhatsApp OTP template, one credit per code.

Voice call

We phone the user and read the digits twice. About 15 seconds of voice time per code. The fallback that gets through when a text is delayed or blocked.

The fallback pattern

Text first. Call if they ask.

Most users get the text at once. For the ones who do not, offer a “call me instead” button that resends the same code by voice. Because you pass the code you already sent, the user hears exactly the digits they were waiting for.

  • Use the code from the first response, or your own generator, in the voice request.
  • Verify once, whichever channel delivered it.
  • Each channel is costed in the response, so you can see what your fallback actually costs.
resend by voice
# 1. text it
POST /v1/otp/send
{ "phone": "233241234567", "channel": "sms", "code": "879599" }
# 2. the user taps "Call me instead"
POST /v1/otp/send
{ "phone": "233241234567", "channel": "voice", "code": "879599" }
→ { "status": "sent",
"cost": { "total": "15s", "currency": "voice seconds" } }
# 3. verify, same as always
POST /v1/otp/verify
{ "phone": "233241234567", "code": "879599" }
→ { "verified": true }

Built in

The parts you would otherwise write yourself.

Generation and storage

Six digits by default, four to eight on request, generated on our side and stored hashed with an expiry. Verification compares and consumes it; a code works once.

Expiry and retries

Codes expire after a few minutes. Send again to issue a fresh code or resend the same one on another channel.

Bring your own code

Already generate codes? Pass "code" and we only deliver it. Verification still works if you want it to.

Questions

About verification.

What does a code cost?+
One SMS credit by text or WhatsApp. By voice, the seconds of the call, about 15, from your voice balance. The exact cost is in every response.
Can I customise the SMS wording?+
Yes. Pass a "template" containing {code} and we send that text from your sender name. Without one, the message reads "Your verification code is 482913. It expires in 5 minutes."
How long is a code valid, and how many tries?+
Five minutes by default; set "ttl" anywhere from one to thirty minutes. Five wrong attempts void the code, and a code is consumed on first successful verification. Codes are stored hashed.
Do I need both balances for the fallback pattern?+
Yes: SMS credits for the text and voice time for the call. Each is bought separately so you can size them to how often users actually ask for a call.

Add verification this afternoon.

Create an account, generate an API key, and send your first code in two requests.