Skip to main content

Validate an App Registration Email Validation

Endpoint​

PUT https://api.verifik.co/v2/email-validations/{id}

This endpoint validates a one-time password (OTP) sent to a user's email address during the onboarding (app registration) process. It ensures the user-provided OTP is correct and updates the verification status accordingly. This route is specifically designed for users who are in the middle of an app registration flow.

warning

The JWT Token you should use when validating Onboarding Email Validations is provided from the App Registration in creation. You must use the token returned when creating an App Registration to authenticate this request.

Headers​

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Params​

NameTypeRequiredDescription
idstringYesThe unique identifier of the Email Validation you want to validate. This is the _id returned when creating the email validation
emailstringYesThe email address that was used to create the email validation. Spaces will be automatically removed and converted to lowercase
otpnumberYesThe one-time password (OTP) that was sent to the user's email address

Request​

const fetch = require("node-fetch");

async function run() {
const emailValidationId = "674de8df21c72be3cc42b8a7";
const res = await fetch(`https://api.verifik.co/v2/email-validations/${emailValidationId}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
email: "user@example.com",
otp: 123456
}),
});
console.log(await res.json());
}

run();

Response​

{
"data": {
"_id": "674de8df21c72be3cc42b8a7",
"status": "validated",
"email": "user@example.com",
"type": "onboarding",
"showFaceLivenessRecommendation": false
}
}

Notes​

  • Onboarding Flow: This endpoint is specifically designed for users in the app registration process, where email validation is part of the onboarding journey.
  • OTP Expiration: OTPs have a limited lifespan (typically 10 minutes) and will expire after the predefined time. Expired OTPs cannot be validated.
  • Status Updates: Successful validation automatically updates the email validation status to "validated" and may trigger additional onboarding steps.
  • Webhook Events: Validation events trigger webhook notifications for tracking and integration purposes.
  • App Registration Linking: When validated through this endpoint, the email validation is automatically linked to the user's app registration record.
  • Email Formatting: Email addresses are automatically converted to lowercase and have spaces removed during processing.
  • Demo Mode: If the project is in demo mode, special demo OTPs may be accepted for testing purposes.