Validate an Email Validation

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

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 updates the verification status accordingly. This route is specifically designed for validation and login type email validations.

Headers

Name
Value

Content-Type

application/json

Body

Name
Type
Required
Description

projectFlow

string

Yes

The unique identifier for the project flow where this email validation was created.

email

string

Yes

The email address that was used to create the email validation (spaces will be automatically removed and converted to lowercase).

otp

number

Yes

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

Body Examples

Basic Validation

{
  "projectFlow": "507f1f77bcf86cd799439015",
  "email": "[email protected]",
  "otp": 123456
}

Validation with Additional Context

{
  "projectFlow": "507f1f77bcf86cd799439015",
  "email": "[email protected]",
  "otp": 123456
}

Request

curl -X POST https://api.verifik.co/v2/email-validations/validate \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "projectFlow": "507f1f77bcf86cd799439015",
    "email": "[email protected]",
    "otp": 123456
  }'

Response

The response will contain information about the validated email validation, including the updated status and any additional data based on the validation type. For validation and login types, this typically includes basic validation information and potentially authentication tokens.

{
  "data": {
    "_id": "674de8df21c72be3cc42b8a7",
    "status": "validated",
    "email": "[email protected]",
    "type": "validation",
    "showFaceLivenessRecommendation": false
  }
}

Notes

  • OTP Expiration: OTPs have a limited lifespan (typically 10 minutes) and will expire after the 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 email validation status to "validated".

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

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

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

  • Email Formatting: Email addresses are automatically converted to lowercase and have spaces removed during processing.

Validation Types

Validation Type

  • General email address validation

  • Returns basic validation information

  • No authentication tokens provided

Login Type

  • Email verification during user login

  • Returns authentication token for authenticated access

  • May include face liveness recommendations

  • Creates or updates app login records

Common Use Cases

  • User Authentication: Verify email ownership during login processes

  • Account Verification: Confirm email addresses for general validation purposes

  • Security: Add an extra layer of security to user authentication flows

  • Integration: Use the returned tokens and status information to integrate with your application's authentication system

This endpoint is specifically designed for validation and login type email validations. For onboarding flows, use the App Registration Email Validation endpoint instead.

Last updated

Was this helpful?