Skip to main content

Create an App Registration Email Validation

Endpoint​

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

This endpoint creates an email validation process specifically for users who are in the middle of an app registration flow. It automatically links the email validation to the user's app registration and handles credit charging for your SmartEnroll plan. A successful response (200) indicates that Verifik has sent an email with an OTP that will be used to complete the email verification process.

warning

The JWT Token you should use when creating App Registration 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
projectstringYesThe project ID where this email validation will be performed. This is the _id generated when creating a project
validationMethodstringYesDefines how the email will be validated. Must be either manual or verificationCode
emailstringYesThe email address that will be validated. This field is required and will be automatically converted to lowercase and whitespace removed
typestringYesThe type of process this email validation is for. Must be one of: validation, login, onboarding, or oneTimeLink
expiresAtstringNoOptional timestamp when the OTP code expires. If not provided, a default expiration time will be set. Format: ISO 8601 (e.g., 2024-12-31T23:59:59.000Z)
redirectUrlstringNoOptional URL where users will be redirected after completing the email validation process
webhookUrlstringNoOptional external webhook URL for receiving real-time notifications about validation status changes
requires2FAbooleanNoOptional boolean indicating whether two-factor authentication is required. Defaults to false
ipAddressstringNoOptional IP address of the user requesting the email validation

Validation Method Values​

ValueDescription
verificationCodeSend OTP code via email for user verification
manualManual verification process without OTP

Type Values​

ValueDescription
onboardingUser registration process (recommended for app registrations)
validationGeneral email validation process
loginUser authentication process
oneTimeLinkOne-time link validation

Request​

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

async function run() {
const res = await fetch("https://api.verifik.co/v2/email-validations/app-registration", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
project: "6266193db77ccc8111730c90",
validationMethod: "verificationCode",
email: "user@example.com",
type: "onboarding"
}),
});
console.log(await res.json());
}

run();

Response​

{
"data": {
"status": "sent",
"validationMethod": "verificationCode",
"extraParams": [],
"type": "onboarding",
"requires2FA": false,
"deleted": false,
"_id": "65c28d66c3abd708cc9b12e2",
"email": "user@example.com",
"project": "6266193db77ccc8322530c90",
"projectFlow": "658ed28b02589f325134d7b78",
"ipAddress": "4.246.194.90",
"emailData": {
"firstName": "John",
"title": "Verifik Client App",
"projectName": "Verifik Client App",
"contactEmail": "support@verifik.co",
"logo": "https://cdn.verifik.co/access/verifikprojectlogo.png",
"authLink": "https://access.verifik.co/sign-up/6266193db77ccc8111730c90?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&otp="
},
"otp": "$2a$10$MCdw130G.RbW4je9Uj2MvuSTzm7.raG23f0Zaasda0FKC1Gl98r0s4D1m",
"expiresAt": "2024-02-06T19:59:58.000Z",
"client": "613375a1eab2fe01237f81e2",
"updatedAt": "2024-02-06T19:49:59.397Z",
"createdAt": "2024-02-06T19:49:59.397Z",
"__v": 0,
"existing": false,
"sent": true
}
}

Notes​

  • App Registration Linking: This endpoint automatically links the email validation to the user's app registration using the appRegistrationId from the authentication token.
  • Credit Charging: Each email validation request consumes credits from your SmartEnroll plan (handled automatically).
  • Enhanced Email Data: The system automatically populates additional email data including the user's first name from their information validation if available.
  • Auth Link Generation: For onboarding flows, the system generates a secure JWT token and auth link for seamless user experience.
  • Duplicate Prevention: If an active email validation already exists for the same email, project flow, and type, the system will resend the existing OTP instead of creating a new one.
  • Security Features: The system validates email security policies and identity verification requirements based on your project flow configuration.
  • Email Format: The email address is automatically converted to lowercase and whitespace is removed.