Skip to main content

Phone Number Verification

Requirements
  • API key pair
  • Service enabled (done by iDenfy's staff)
  • Number verification credits
Image alt text

Phone Number Risk Scoring for Instant Validation

  • Verify identity seamlessly using phone number OTP.
  • Fast verification for genuine users (<30s).
  • Global coverage, 2FA security, automated onboarding.

Step 1: SMS with verification code

send verification code

Authorization: API key pair
Method: POST
Endpoint: https://ivs.idenfy.com/fraud/send-sms

Calling the endpoint will send an SMS message containing a verification code to the user.

Request structure

KeyRequiredTypeConstraintsDefaultExplanation
phone_numberYesStringE.164 format-Phone number with country code, to which will be sent the verification code via SMS message
sender_nameNoString- Max length 11iDenfyName or number which will be displayed as sender number/name

Receiving response

KeyTypeExplanation
request_idStringYou will need this for the verification step

Request example

{
"phone_number": "+12025550163",
"sender_name": "The Sender"
}

Response example

{
"request_id": "3d50e1584e0946e789e0185c009aaadf"
}

Example sent SMS message

The Sender code: 1234. Valid for 5 minutes.

Step 2: Verifying user-entered code

number validation

Authorization: API key pair
Method: POST
Endpoint: https://ivs.idenfy.com/fraud/verify-sms

After the verification code is sent, the user can enter the code they received, and we can verify if it is valid.

Request structure

KeyRequiredTypeConstraintsExplanation
request_idYesString- Min Length 32
- Max Length 40
request_id which was returned from SMS message sending endpoint
received_codeYesString- Length 4Numerical verification code which was entered by user

Response structure

KeyTypeExplanation
is_verifiedBoolIf true, the received_code was valid, if false, the received_code was invalid, already validated, or the wrong received_code was provided too many times

Request example

{
"request_id": "3d50e1584e0946e789e0185c009aaadf",
"received_code": "1234"
}

Response example

{
"is_verified": true
}