Skip to main content

Verify OTP

Validate the OTP code entered by the user against the verification that was started.

Endpoint​

POST https://exoverify.exotel.com/v2/accounts/{account_sid}/verifications/sms/{verification_id}

Headers​

HeaderValue
AuthorizationBasic <base64(Application_ID:Application_Secret)>
Content-Typeapplication/json

Request Parameters​

ParameterRequiredTypeDescription
OTPMandatoryStringThe OTP code entered by the user

Code Examples​

curl -X POST "https://exoverify.exotel.com/v2/accounts/<account_sid>/verifications/sms/<verification_id>" \
-H "Authorization: Basic <base64_credentials>" \
-H "Content-Type: application/json" \
-d '{ "OTP": "123456" }'

Success Response​

HTTP 200

{
"verification_id": "ver_abc123def456",
"application_id": "your_app_id",
"account_sid": "your_account_sid",
"status": "success",
"date_created": "2024-01-15T10:30:00Z",
"date_updated": "2024-01-15T10:30:45Z"
}

Error Codes​

HTTPCodeDescription
4001210OTP expired — the 60-second window has passed
4001211Invalid OTP — the code entered is incorrect
4031016Max attempts exceeded — user tried more than 10 times
4031017Verification already completed

Flow Summary​

Start Verification → User receives OTP → User enters OTP → Verify OTP
→ success ✓
→ 1211 (wrong OTP, try again)
→ 1210 (expired, start new verification)
→ 1016 (too many attempts, start new)
note

After a successful verification, the same verification_id cannot be used again. If you need to re-verify, call Start Verification to get a new verification_id.

Try It​