Validate a Phone Validation

POST https://api.verifik.co/v2/phone-validations/validate

This endpoint validates a one-time password (OTP) sent to a user's phone number as part of the phone verification process. It ensures the user-provided OTP is correct and updates the verification status accordingly.

Headers

Name
Value

Content-Type

application/json

Body

Name
Type
Required
Description

phone

string

Yes

The phone number that was used to create the phone validation.

countryCode

string

Yes

The country code of the phone number in format +XXX (e.g., +507 for Panama).

otp

number

Yes

The one-time password (OTP) that was sent to the user's phone number.

project

string

No

The unique identifier for the project (optional, helps narrow down the validation).

projectFlow

string

No

The unique identifier for the project flow (optional, helps narrow down the validation).

phoneGateway

string

No

The delivery method used: sms, whatsapp, or none.

Body Examples

Basic Validation

{
  "phone": "62647737",
  "countryCode": "+507",
  "otp": 123456
}

Advanced Validation with Project Details

{
  "phone": "62647737",
  "countryCode": "+507",
  "otp": 123456,
  "project": "507f1f77bcf86cd799439011",
  "projectFlow": "507f1f77bcf86cd799439015",
  "phoneGateway": "whatsapp"
}

Request

curl -X POST https://api.verifik.co/v2/phone-validations/validate \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "62647737",
    "countryCode": "+507",
    "otp": 123456
  }'

Response

The response will contain information about the validated phone validation, including the updated status and any additional data based on the validation type.

{
  "data": {
    "_id": "674de8df21c72be3cc42b8a7",
    "status": "validated",
    "countryCode": "+507",
    "phone": "62647737",
    "type": "validation",
    "showFaceLivenessRecommendation": false
  }
}

Notes

  • OTP Expiration: OTPs have a limited lifespan and will expire after a predefined time. Expired OTPs cannot be validated.

  • Demo Mode: If the project is in demo mode, special demo OTPs may be accepted for testing purposes.

  • Status Updates: Successful validation automatically updates the phone validation status to "validated".

  • Webhook Events: Validation events trigger webhook notifications for tracking and integration purposes.

  • Login Tokens: For login-type validations, a JWT token is returned for authenticated access.

  • Face Liveness: Some project flows may recommend face liveness verification after phone validation.

Last updated

Was this helpful?