+254 722 117 850 Support Login
Products Authentication & OTP
Verification · Live

The code arrives before they put the phone down.

One API call sends your code on WhatsApp first, by SMS if WhatsApp does not get it there, and then by a voice call that reads it out — each only if the one before did not arrive. Login, password reset, transaction approval, KYC. You generate the code; Sozuri delivers it and never logs it.

Median < 3s All Kenyan carriers WhatsApp, SMS & voice
BIDII BANK OTP · Login
Bidii Bank Your verification code is
4821
Expires in 5 minutes. Never share this code.
Delivered · 2.1s Safaricom · status: success · messageId OTP-9X4K
Endpoint POST /api/v1/otp
Median latency Under 3 seconds
Auth Bearer token + project
Webhook One, when it is decided
How it works

Three calls. Verified user.

One request carries the code and the order of channels. Sozuri moves to the next channel on its own: when one is refused, reports a failure, or shows no delivery within the time you set.

1

Generate & persist

Generate a 4–6 digit code in your backend. Hash it, store it with the user ID and an expiry (recommend 5 minutes). Never log the raw code.

2

Send via Sozuri

POST to /v1/otp with the code, the number and channels — for example ["whatsapp", "sms", "voice"]. WhatsApp uses your approved authentication template; SMS your transactional sender ID.

3

Verify and rotate

Customer enters the code, you compare the hash, mark single-use, increment fail counter. One webhook tells you which channel carried it, or that none could.

What you get

Built for high-stakes verification

Sub-3-second median

Safaricom routes are tuned for transactional SMS. Most OTPs arrive faster than the customer can switch apps.

Transactional sender ID

Use your bank, fintech or app name as the visible sender. Customers recognise it instantly — reduces phishing-fatigue dismissals.

Falls back on its own

WhatsApp first. If it fails, or no delivery arrives in your time limit (30 seconds by default), the SMS goes; if the SMS is not delivered either, a call reads the code digit by digit. Each at most once — never a second SMS.

Audit-grade logging

Every OTP send is logged with timestamp, sender, recipient, message ID and delivery state. Exportable for ISO 27001 / PCI / NCA audits.

Project-isolated API keys

Separate dev, staging, production projects — each with its own Bearer key, callback URL and balance. Rotate any key instantly.

One webhook, when it is decided

Give a callback_url and one signed otp.status POST arrives when the code was delivered, handed to its last channel, or could not be sent — or ask GET /v1/otp/{id} at any time.

In the API

One call. Three channels.

The code, the number and the order of channels: "channels": ["whatsapp", "sms", "voice"]. Each channel is billed at its own rate, and only when it is used — a code WhatsApp delivered costs one WhatsApp message.

  • Bearer token + project in body authenticates the request
  • The SMS goes on Sozuri's transactional priority queue, from your sender ID
  • The call reads the code one digit at a time, and is never recorded
The OTP API reference →
send-otp.sh
# Send a verification code: WhatsApp, then SMS, then a call
curl -X POST "https://sozuri.net/api/v1/otp" \
  -H "Authorization: Bearer $SOZURI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project":        "Bidii Bank",
    "to":             "254700000000",
    "code":           "4821",
    "channels":       ["whatsapp", "sms", "voice"],
    "fallback_after": 30,
    "sms":            { "from": "BIDII BANK" },
    "voice":          { "brand": "Bidii Bank" },
    "callback_url":   "https://bidii.example/hooks/otp"
  }'
Authentication errors to handle 404 "Project not found." — check the project name (case-sensitive). 400 "Unknown project." — API key doesn't match. 401 "Unauthenticated." — no token at all. Rotating a key invalidates the old one immediately with no overlap window.
Where it fits

Anywhere a customer needs to prove who they are

Login & password reset

Two-factor authentication, reset codes, suspicious-login challenges. The minimum bar for any app handling money.

High-value transactions

Step-up auth for transfers over a threshold, beneficiary additions, card disputes. Audit-logged for regulator inspection.

KYC & signup verification

Confirm phone ownership at signup. Same flow whether the customer is on Safaricom, Airtel or Telkom.

Common questions

OTP and API auth specifics

Is there a separate OTP endpoint?

Yes: POST /v1/otp delivers a code on WhatsApp, SMS and voice with the fallbacks handled for you. A code sent as an ordinary SMS through /v1/messaging with type: "transactional" still works, on the same priority routes.

Do you generate the code for me?

By design, no. Generate, hash and store the code on your side; you control entropy, format, expiry and rotation. Sozuri delivers it and never checks it or writes it to a log, and the WhatsApp conversation shows the wording without the code. An SMS fallback is an ordinary SMS, so it appears in your SMS log like any other.

How do I rotate my API key?

From the project dashboard, click Regenerate. The new key is immediately active and the old one is revoked. Plan a brief deploy window; there is no overlap period.

What happens if delivery fails?

With /v1/otp the next channel in your list goes on its own: at once when WhatsApp reports a failure or a channel refuses, and after fallback_after seconds when no delivery arrives. If no channel can take it, the OTP is failed and the webhook says so. A code sent through /v1/messaging reports its outcome on the delivery webhook instead.

4 8 2 1 delivered in 2.1s · safaricom
Your move

Verify users on the rail that never sleeps.

SMS reaches every Kenyan phone, online or offline, smartphone or feature. For authentication, that's the only reach metric that matters.

Chat on WhatsApp
Your first SMS in the time it takes to brew coffee. Start building in minutes