Create an App Registration Phone Validation

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

A Phone Validation is an instance within Verifik's system that allows you to process and validate phone numbers during the app registration process. This process ensures the authenticity of user phone numbers and provides secure verification through SMS or WhatsApp delivery methods.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

project

string

The unique identifier for the project where this phone validation will be used.

validationMethod

string

The validation method, set to verificationCode.

phone

string

The phone number that will be validated (spaces will be automatically removed).

countryCode

string

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

type

string

Type of validation: validation, login, onboarding, or oneTimeLink.

expiresAt

string

Optional expiration date for the validation code.

redirectUrl

string

Optional URL for redirect after validation.

webhookUrl

string

Optional webhook URL for validation notifications.

identityUrl

string

Optional identity verification URL.

requires2FA

boolean

Optional flag indicating if two-factor authentication is required.

ipAddress

string

Optional IP address of the user.

validationMethod Values

Value
Description

verificationCode

Sends a one-time password (OTP) to the phone number for verification.

type Values

Value
Description

validation

General phone number validation. For general phone validations - you must use Create a Phone Validation

login

Phone verification during user login. For login phone validations - you must use Create a Phone Validation

onboarding

Phone verification during user registration.

Minimal Body Data

{
  "project": "507f1f77bcf86cd799439011",
  "validationMethod": "verificationCode",
  "phone": "62647737",
  "countryCode": "+507",
  "type": "onboarding"
}

Full Body Data

{
  "project": "507f1f77bcf86cd799439011",
  "validationMethod": "verificationCode",
  "phone": "62647737",
  "countryCode": "+507",
  "type": "validation",
  "expiresAt": "2024-12-31T23:59:59.000Z",
  "redirectUrl": "https://yourapp.com/success",
  "webhookUrl": "https://yourapp.com/webhook",
  "identityUrl": "https://yourapp.com/identity",
  "requires2FA": false,
  "ipAddress": "192.168.1.1"
}

Request

curl -X POST https://api.verifik.co/v2/phone-validations/app-registration \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "project": "507f1f77bcf86cd799439011",
    "validationMethod": "verificationCode",
    "phone": "62647737",
    "countryCode": "+507",
    "type": "validation"
  }'

Response

The response will contain information about the new Phone Validation instance. Important fields include the unique identifier _id, the status of the validation process, and the encrypted OTP that was sent to the user.

{
  "data": {
    "client": "507f1f77bcf86cd799439013",
    "project": "507f1f77bcf86cd799439011",
    "projectFlow": "507f1f77bcf86cd799439015",
    "status": "sent",
    "countryCode": "+507",
    "phone": "62647737",
    "phoneGateway": "whatsapp",
    "otp": "$2a$10$/v55.1QmwlCdX6zD1jy51OF87POIDZzj30.UmTtp13pZv6uKm.a.m",
    "expiresAt": "2024-12-02T17:15:35.000Z",
    "phoneData": {},
    "type": "validation",
    "redirectUrl": "https://api.verifik.co",
    "requires2FA": false,
    "ipAddress": "172.17.0.1",
    "language": "en",
    "_id": "674de8df21c72be3cc42b8a7",
    "updatedAt": "2024-12-02T17:05:36.788Z",
    "createdAt": "2024-12-02T17:05:36.788Z",
    "__v": 0,
    "new": true
  }
}

Notes

  • Country Code Format: The countryCode must be in the format +XXX where X are digits (1-3 digits maximum).

  • Phone Number: Spaces in phone numbers are automatically removed during processing.

  • OTP Security: The OTP is encrypted using bcrypt before storage for security.

  • Default Gateway: Phone validations default to WhatsApp delivery method.

  • Automatic Linking: When created through the app-registration endpoint, the phone validation is automatically linked to the user's app registration record.

Last updated

Was this helpful?