Create an App Login Biometric Validation
Endpointβ
POST https://api.verifik.co/v2/biometric-validations/app-login
Overviewβ
A Biometric Validation is an instance within Verifik's system that allows you to process and validate user identities through facial recognition and liveness detection during the login process. This endpoint is specifically designed for users who are in the middle of an app login flow.
Headersβ
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer {YOUR_ACCESS_TOKEN} |
warning
The JWT Token you should use when creating App Login Biometric Validations is provided from the App Login in creation.
Parametersβ
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | The unique identifier for the project where this biometric validation will be used. |
projectFlow | string | Yes | The unique identifier for the project flow configuration. |
identifier | string | Yes | A unique identifier for the user or session (e.g., email, phone, or custom ID). |
type | string | Yes | Must be set to login for this endpoint. |
expiresAt | string | No | Optional expiration date for the validation session. |
redirectUrl | string | No | Optional URL for redirect after validation. |
webhookUrl | string | No | Optional webhook URL for validation notifications. |
requires2FA | boolean | No | Optional flag indicating if two-factor authentication is required. |
ipAddress | string | No | Optional IP address of the user. |
sendViaEmail | boolean | No | Optional flag to send validation link via email. |
email | string | No | Email address to send validation link to (required if sendViaEmail is true). |
language | string | No | Language for email templates (en/es). Defaults to "en". |
Requestβ
- JavaScript
- Python
- PHP
- Swift
import axios from 'axios';
const options = {
method: 'POST',
url: 'https://api.verifik.co/v2/biometric-validations/app-login',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
},
data: {
project: '507f1f77bcf86cd799439011',
projectFlow: '507f1f77bcf86cd799439015',
identifier: 'user@example.com',
type: 'login',
expiresAt: '2024-12-31T23:59:59.000Z',
redirectUrl: 'https://yourapp.com/success',
webhookUrl: 'https://yourapp.com/webhook',
requires2FA: false,
ipAddress: '192.168.1.1',
sendViaEmail: true,
email: 'user@example.com',
language: 'en'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
import http.client
import json
conn = http.client.HTTPSConnection("api.verifik.co")
payload = json.dumps({
"project": "507f1f77bcf86cd799439011",
"projectFlow": "507f1f77bcf86cd799439015",
"identifier": "user@example.com",
"type": "login",
"expiresAt": "2024-12-31T23:59:59.000Z",
"redirectUrl": "https://yourapp.com/success",
"webhookUrl": "https://yourapp.com/webhook",
"requires2FA": False,
"ipAddress": "192.168.1.1",
"sendViaEmail": True,
"email": "user@example.com",
"language": "en"
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
}
conn.request("POST", "/v2/biometric-validations/app-login", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.verifik.co/v2/biometric-validations/app-login', [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer <your_token>',
],
'json' => [
'project' => '507f1f77bcf86cd799439011',
'projectFlow' => '507f1f77bcf86cd799439015',
'identifier' => 'user@example.com',
'type' => 'login',
'expiresAt' => '2024-12-31T23:59:59.000Z',
'redirectUrl' => 'https://yourapp.com/success',
'webhookUrl' => 'https://yourapp.com/webhook',
'requires2FA' => false,
'ipAddress' => '192.168.1.1',
'sendViaEmail' => true,
'email' => 'user@example.com',
'language' => 'en'
]
]);
echo $response->getBody();
import Foundation
let headers = [
"Content-Type": "application/json",
"Authorization": "Bearer <your_token>"
]
let parameters = [
"project": "507f1f77bcf86cd799439011",
"projectFlow": "507f1f77bcf86cd799439015",
"identifier": "user@example.com",
"type": "login",
"expiresAt": "2024-12-31T23:59:59.000Z",
"redirectUrl": "https://yourapp.com/success",
"webhookUrl": "https://yourapp.com/webhook",
"requires2FA": false,
"ipAddress": "192.168.1.1",
"sendViaEmail": true,
"email": "user@example.com",
"language": "en"
] as [String : Any]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.verifik.co/v2/biometric-validations/app-login")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Responseβ
- 200
- 403
- 409
- 404
{
"data": {
"livenessSession": {
"_id": "674de8df21c72be3cc42b8a7",
"identifier": "user@example.com",
"client": "507f1f77bcf86cd799439013",
"project": "507f1f77bcf86cd799439011",
"projectFlow": "507f1f77bcf86cd799439015",
"status": "active",
"expiresAt": "2024-12-02T17:15:35.000Z",
"createdAt": "2024-12-02T17:05:36.788Z",
"updatedAt": "2024-12-02T17:05:36.788Z"
},
"biometricValidation": {
"_id": "674de8df21c72be3cc42b8a8",
"client": "507f1f77bcf86cd799439013",
"project": "507f1f77bcf86cd799439011",
"projectFlow": "507f1f77bcf86cd799439015",
"status": "new",
"livenessSession": "674de8df21c72be3cc42b8a7",
"type": "login",
"url": "https://access.verifik.co/sign-in/507f1f77bcf86cd799439011?type=liveness",
"assignedCollection": "507f1f77bcf86cd799439016",
"collectionCode": "col_12345",
"redirectUrl": null,
"webhook": null,
"requires2FA": false,
"createdAt": "2024-12-02T17:05:36.788Z",
"updatedAt": "2024-12-02T17:05:36.788Z"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
{
"code": "token_not_right",
"message": "403:token_not_right"
}
{
"code": "MissingParameter",
"message": "missing project"
}
{
"code": "Project_not_found_or_featured_disabled",
"message": "404:Project_not_found_or_featured_disabled"
}
Featuresβ
- Login-Specific Validation: Designed specifically for app login biometric validation flows
- Liveness Detection: Advanced facial recognition with anti-spoofing technology
- Secure Sessions: Automatic creation of secure liveness sessions with expiration
- Multiple Programming Languages: Support for JavaScript, Python, PHP, and Swift
- Email Integration: Optional email notifications with validation links
- Webhook Support: Real-time notifications for validation events
- Multi-language Templates: Support for English and Spanish email templates
- Security Features: IP address tracking and 2FA support