Validate Email Validation

Endpoint

POST /v2/email-validations/validate

Description

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

Headers

Header
Type
Required
Description

Content-Type

String

Yes

Set to application/json.

Authorization

String

Yes

Bearer token for API authorization.

Body Parameters

Parameter
Type
Required
Description

project

String

Yes

Unique identifier for the project.

projectFlow

String

Yes

Identifier for the specific project flow.

email

String

Yes

Email address of the user to validate.

validationMethod

String

Yes

The validation method, set to verificationCode.

type

String

Yes

Type of validation, e.g., login.

otp

String

Yes

The one-time password provided by the user.

Request

const axios = require('axios');

let data = JSON.stringify({
  "project": "6266193db77ccc8111730c90",
  "projectFlow": "65bed28b0990f300134d7b78",
  "email": "miguel@verifik.co",
  "validationMethod": "verificationCode",
  "type": "login",
  "otp": "884632"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://app.verifik/v2/email-validations/validate',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer <your-token>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Response

{
  "email": "miguel@verifik.co",
  "type": "login",
  "showFaceLivenessRecommendation": true,
  "appLogin": {
    "_id": "674ddbf121c72be3cc42b884",
    "client": "613375a1eab2fe08527f81e2",
    "name": "JORGE ELIECER REINA SANCHEZ",
    "status": "validated",
    "project": "6266193db77ccc8112730c90",
    "projectFlow": "65bed28b0990f310134d7b78",
    "type": "email",
    "emailValidation": "674ddbf121c72be3cc42b882",
    "updatedAt": "2024-12-02T16:10:58.161Z",
    "createdAt": "2024-12-02T16:10:25.151Z"
  },
  "token": "eyJhbGciOiJIUzI1..."
}

Response Body

Parameter
Type
Description

email

String

Email address that was validated.

type

String

Validation type, e.g., login.

showFaceLivenessRecommendation

Boolean

Indicates if face liveness check is recommended.

appLogin

Object

Contains detailed information about the validated login session.

appLogin._id

String

Unique ID of the login session.

appLogin.name

String

Name of the user.

appLogin.status

String

Status of the validation, e.g., validated.

token

String

JWT token generated after successful validation.

Notes

  • The OTP must be generated beforehand and sent to the user's email.

  • Ensure your application handles JWT tokens securely after validation.

  • If face liveness is recommended, guide users to complete this step in your flow

Last updated