Skip to main content

Create an Email Validation

Endpoint​

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

An Email Validation is an instance within Verifik's system that allows you to process and validate email addresses during authentication and registration processes. This process ensures the authenticity of user email addresses and provides secure verification through email delivery methods.

Headers​

Content-Type​

Type: String
Required: Required
Value: application/json

Authorization​

Type: String
Required: Required
Value: Bearer {YOUR_ACCESS_TOKEN}

Body Parameters​

project​

Type: String
Required: Yes

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

validationMethod​

Type: String
Required: Yes

The validation method, set to verificationCode or oneTimeLink.

email​

Type: String
Required: Yes

The email address that will be validated (spaces will be automatically removed and converted to lowercase).

type​

Type: String
Required: Yes

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

expiresAt​

Type: String
Required: No

Optional expiration date for the validation code.

redirectUrl​

Type: String
Required: No

Optional URL for redirect after validation.

webhookUrl​

Type: String
Required: No

Optional webhook URL for validation notifications.

identityUrl​

Type: String
Required: No

Optional identity verification URL.

requires2FA​

Type: Boolean
Required: No

Optional flag indicating if two-factor authentication is required.

ipAddress​

Type: String
Required: No

Optional IP address of the user.

validationMethod Values​

ValueDescription
verificationCodeSends a 6-digit OTP code to the email address
oneTimeLinkSends a single-use link to the email address

Request​

import axios from 'axios';

const options = {
method: 'POST',
url: 'https://api.verifik.co/v2/email-validations',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
},
data: {
project: 'project_123456789',
validationMethod: 'verificationCode',
email: 'user@example.com',
type: 'validation',
expiresAt: '2024-01-15T11:30:00Z',
redirectUrl: 'https://example.com/success',
webhookUrl: 'https://example.com/webhook',
requires2FA: false,
ipAddress: '192.168.1.1'
}
};

try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}

Response​

Response​

{
"success": true,
"data": {
"_id": "email_validation_123456789",
"client": "client_123456789",
"project": "project_123456789",
"projectFlow": "flow_123456789",
"status": "sent",
"email": "user@example.com",
"type": "validation",
"validationMethod": "verificationCode",
"verificationCode": "123456",
"expiresAt": "2024-01-15T11:30:00Z",
"redirectUrl": "https://example.com/success",
"webhookUrl": "https://example.com/webhook",
"requires2FA": false,
"ipAddress": "192.168.1.1",
"attempts": 0,
"maxAttempts": 3,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
},
"signature": {
"dateTime": "April 11, 2023 12:25 PM",
"message": "Certified by Verifik.co"
}
}

Characteristics​

  • Validation Creation: Creates new email validations with complete configuration
  • Multiple Methods: Support for verification codes and single-use links
  • Validation Types: Standard validation, login, onboarding and unique links
  • Advanced Configuration: Redirect URLs, webhooks and two-factor authentication
  • Security: Attempt control, expiration and abuse prevention
  • Multiple Languages: Support for JavaScript, Python, PHP and Swift
  • Error Handling: Detailed error responses for different scenarios