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.
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.
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.
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.
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.
Safaricom routes are tuned for transactional SMS. Most OTPs arrive faster than the customer can switch apps.
Use your bank, fintech or app name as the visible sender. Customers recognise it instantly — reduces phishing-fatigue dismissals.
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.
Every OTP send is logged with timestamp, sender, recipient, message ID and delivery state. Exportable for ISO 27001 / PCI / NCA audits.
Separate dev, staging, production projects — each with its own Bearer key, callback URL and balance. Rotate any key instantly.
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.
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.
project in body authenticates the request# 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"
}'
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.
Two-factor authentication, reset codes, suspicious-login challenges. The minimum bar for any app handling money.
Step-up auth for transfers over a threshold, beneficiary additions, card disputes. Audit-logged for regulator inspection.
Confirm phone ownership at signup. Same flow whether the customer is on Safaricom, Airtel or Telkom.
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.
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.
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.
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.
SMS reaches every Kenyan phone, online or offline, smartphone or feature. For authentication, that's the only reach metric that matters.