Create Biometric Validation

Description

This endpoint is used to create a new biometric validation session for a user. The validation can be used for various flows, such as login, and includes biometric data for liveness checks.

URL

https://api.verifik.co/v2/biometric-validations

Method

POST

Request Body Parameters

Example Request

curl --location --request POST 'https://api.verifik.co/v2/biometric-validations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "project": "66df5bf5c4d855fb0bdf5da2",
    "projectFlow": "66df5c22c4d855fb0bdf5da9",
    "identifier": "03da12fba",
    "type": "login"
}'

Example Node.js (Axios) Request

const axios = require('axios');

let data = JSON.stringify({
  "project": "66df5bf5c4d855fb0bdf5da2",
  "projectFlow": "66df5c22c4d855fb0bdf5da9",
  "identifier": "03da12fba",
  "type": "login"
});

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

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

Example Response

{
    "data": {
        "livenessSession": {
            "client": "613375a1eab2fe08527f81e2",
            "project": "66df5bf5c4d855fb0bdf5da2",
            "projectFlow": "66df5c22c4d855fb0bdf5da9",
            "identifier": "03da12fba",
            "status": "active",
            "livenessResult": [],
            "comparisonResult": [],
            "generalInformation": [],
            "documentTypeFields": [],
            "location": [],
            "proFields": [],
            "studioFields": [],
            "promptFields": [],
            "expiresAt": "2024-09-12T17:30:26.000Z",
            "_id": "66e3244269cd15b505d21063",
            "activatedAt": "2024-09-12T17:26:26.954Z",
            "updatedAt": "2024-09-12T17:26:26.964Z",
            "createdAt": "2024-09-12T17:26:26.964Z",
            "__v": 0
        },
        "biometricValidation": {
            "client": "613375a1eab2fe08527f81e2",
            "project": "66df5bf5c4d855fb0bdf5da2",
            "projectFlow": "66df5c22c4d855fb0bdf5da9",
            "livenessSession": "66e3244269cd15b505d21063",
            "status": "new",
            "type": "login",
            "url": "http://localhost:4400/sign-in/66df5bf5c4d855fb0bdf5da2?type=liveness",
            "livenessScore": 0,
            "assignedCollection": "66df5bf5c4d855fb0bdf5da4",
            "collectionCode": "d29fe454-3ecc-4f58-8666-4021ac575d9c",
            "requires2FA": false,
            "_id": "66e3244369cd15b505d21065",
            "updatedAt": "2024-09-12T17:26:27.068Z",
            "createdAt": "2024-09-12T17:26:27.068Z",
            "__v": 0
        },
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsaXZlbmVzc1Nlc3Npb24iOiI2NmUzMjQ0MjY5Y2QxNWI1MDVkMjEwNjMiLCJleHBpcmVzQXQiOiIyMDI0LTA5LTEyIDE3OjMwOjI2IiwiaWF0IjoxNzI2MTYxOTg3fQ.-Gu67q0UpKR8T_Hg3fSpjizsO3j1w1ewV1cNFR8je4U"
    }
}

Response Details

  • livenessSession: The data for the liveness session created as part of this biometric validation.

    • client: The unique identifier for the client.

    • project: The project ID associated with the biometric validation.

    • projectFlow: The flow ID for this project.

    • identifier: The unique identifier for the session.

    • status: The status of the liveness session (e.g., "active").

    • livenessResult: Any results from the liveness check (array).

    • comparisonResult: Any results from biometric comparisons (array).

    • generalInformation: Any general information related to the session (array).

    • expiresAt: The expiry timestamp for the session.

    • activatedAt: The activation timestamp for the session.

    • updatedAt: The last updated timestamp.

    • createdAt: The creation timestamp.

    • _id: The unique identifier for the liveness session.

  • biometricValidation: The data for the biometric validation itself.

    • client: The client ID for this validation.

    • project: The project ID for this validation.

    • projectFlow: The flow ID for this validation.

    • livenessSession: The associated liveness session ID.

    • status: The status of the biometric validation (e.g., "new").

    • type: The type of validation (e.g., "login").

    • url: A URL related to the biometric validation, typically for a liveness check.

    • livenessScore: The score from the liveness check.

    • assignedCollection: The collection ID assigned to this validation.

    • collectionCode: A unique collection code.

    • requires2FA: A boolean indicating whether the validation requires 2FA (Two-Factor Authentication).

    • createdAt: The creation timestamp for the validation.

    • updatedAt: The last updated timestamp for the validation.

    • _id: The unique identifier for the biometric validation.

  • token: A JWT token associated with the liveness session, containing an expiration timestamp and other information.

Error Responses

Notes

  • Ensure that the Authorization token is valid and not expired.

  • The project, projectFlow, and identifier fields are required for initiating the biometric validation.

  • The token returned can be used for subsequent validation operations.

Last updated