A voice OTP is a phone call that reads a one-time password to your user, twice, so they can type it into your app. On Sautikit a 25-second answered OTP call costs KES 1.25, billed per second, and a call that is not answered costs nothing.
It is the fallback for fintechs, lenders, SACCOs and any app that verifies phone numbers when an SMS code does not arrive.
Send the SMS first. If the user has not entered the code after 30 seconds, or taps "call me instead", place the voice call. If the call is not answered, show a "try again" button.
Speak each digit on its own with a pause, and say the code twice. "8. 4. 7. 2. 9. 3." is read as six separate digits. Start with your business name so the user knows the call is expected.
Set this URL as the voice_callback_url on your number with PUT /v1/numbers/{id}/routing. On an outgoing call, the person you dialled is in clientDialedNumber.
import express from "express";const app = express();app.use(express.json());app.post("/voice/otp", async (req, res) => { const phone = req.body.clientDialedNumber; const code = await otpStore.find(phone); // "847293" if (!code) { return res.json({ actions: [ { say: { text: "Your code has expired. Please request a new one in the app." } }, { hangup: {} }, ], }); } const spoken = code.split("").join(". ") + "."; // "8. 4. 7. 2. 9. 3." res.json({ actions: [ { say: { text: `This is your verification call. Your code is: ${spoken} Once more: ${spoken}`, }, }, { hangup: {} }, ], });});app.listen(3000);
The user types the code into your app and your server checks it against the stored value, with the same expiry and attempt limits you use for SMS codes.