Verify OTP

Validate the OTP for successful verification

post/verify_otp

Request

  • Base URL: https://api.myotp.app
  • URL: https://api.myotp.app/verify_otp
  • Auth: none declared. Required headers: X-API-Key

Headers

X-API-Keystring required

API key for authentication

Request body

phone_numberstring

Phone number to verify the OTP

message_idstring

ID of the message to verify. When supplied, the check is scoped to that one challenge: a code from any other message to the same number does not verify. Supply it whenever you have it. Without it, the most recent active code for phone_number is checked.

otpstring required

OTP to verify

Response

OTP verification result

status'success' | 'failed'

Status of the OTP verification

reason'invalid' | 'expired' | 'not found'

Present when status is failed. An expired code answers status failed with reason expired. A code accepts five wrong attempts: the fifth answers invalid and deletes the code, and later attempts fail until a new code is sent.

messagestring

Message describing the status of the OTP verification

Changes

No recorded changes to this operation across all 1 revision of this API.