OTP Verification API
A complete send-and-verify flow for phone number verification. Built-in expiry, attempt limits, and secure bcrypt hashing.
Verification Flow
1
Send OTP
POST /otp/send
Send an OTP to the user's phone number. The API returns an otpRequestId for tracking.
2
User Enters OTP
Your app
Show an input field in your app where the user enters the OTP they received via SMS.
3
Verify OTP
POST /otp/verify
Send the otpRequestId and the code the user entered. The API validates against the bcrypt-hashed original.
Verify Request
POST /otp/verify
Content-Type: application/json
X-API-Key: sm_live_your_api_key_here
{
"otpRequestId": "uuid-from-send-response",
"otp": "123456"
}Verify Response
{
"success": true,
"statusCode": 200,
"requestId": "req_xyz789",
"timestamp": "2026-02-15T10:31:00.000Z",
"data": {
"verified": true,
"otpRequestId": "uuid-from-send-response"
}
}Verification API FAQ
Related Pages
Add Phone Verification to Your App
Implement send-and-verify OTP flow in minutes. No DLT registration needed.