Skip to main content
Phone-based two-factor authentication - generate a 6-digit OTP, call the user, and read it digit by digit. XML elements used: <Speak>, <Gather inputType=dtmf numDigits=1>, <Redirect>, <Hangup>

View on GitHub

Clone and run the full working example

Getting started

Overview

Your app calls POST /send-otp with a phone number. The server generates a 6-digit OTP with a 5-minute TTL, triggers an outbound Vobiz call, and reads the code aloud one digit at a time with 1-second pauses. The user can press 1 to hear the code again. Your app then calls POST /verify-otp to check the code.

Call flow

Vobiz webhooks

Set /answer as the Answer URL in your Vobiz application.

App API

Environment variables