Skip to main content

Create a Document Liveness Validation

Endpoint​

POST https://api.verifik.co/v2/document-liveness

A Document Liveness Validation is the result of all validations performed on a document passed via a base64 image. We have four types of validations that we perform on the document: Screen Replay, Printed Copy, Portrait Substitution, Digital Manipulation. You can also decide to store the base64 in our CDN so you can retrieve the image that you tested.

Headers​

Content-Type​

Type: String
Required: Yes

application/json

Authorization​

Type: String
Required: Yes

Bearer <token>

Body Parameters​

image​

Type: blob
Required: Yes

The document to test in base64 format.

saveImage​

Type: Boolean
Required: No

This boolean will define if we save the image or not for further inspection.

validateScreenReplay​

Type: Boolean
Required: No

Perform a validation to check if the attack came from a screen replay

validatePrintedCopy​

Type: Boolean
Required: No

Perform a validation to check if the attack came from a printed copy

validatePortraitSubstitution​

Type: Boolean
Required: No

Perform a validation to check if the attack came from a portrait substitution

validateDigitalManipulation​

Type: Boolean
Required: No

Perform a validation to check if the attack came from a digital manipulation

screenReplayCalibration​

Type: string
Required: No

You can adjust the calibration from SOFT, REGULAR or HARD. Default value is REGULAR.

printedCopyCalibration​

Type: string
Required: No

You can adjust the calibration from SOFT, REGULAR or HARD. Default value is REGULAR.

portraitSubstitutionCalibration​

Type: string
Required: No

You can adjust the calibration from SOFT, REGULAR or HARD. Default value is REGULAR.

ignoreDocumentCroppedValidation​

Type: Boolean
Required: No

It will ignore if the document was cropped.

ignoreColourLessValidation​

Type: Boolean
Required: No

It will ignore the lack of color in the document.

Request​

import axios from 'axios';

const options = {
method: 'POST',
url: 'https://api.verifik.co/v2/document-liveness',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
},
data: {
image: 'base64_encoded_document_image',
saveImage: true,
validatePrintedCopy: true,
validateScreenReplay: true,
validatePortraitSubstitution: true,
validateDigitalManipulation: true,
screenReplayCalibration: 'REGULAR',
printedCopyCalibration: 'REGULAR',
portraitSubstitutionCalibration: 'REGULAR',
ignoreDocumentCroppedValidation: false,
ignoreColourLessValidation: false
}
};

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

Response​

{
"data": {
"client": "68f18d25aafc7dbd2a0bd416",
"imageSaved": true,
"imageUrl": "https://cdn.verifik.co/document-liveness/document-liveness-1761614605009",
"validateScreenReplay": true,
"validatePrintedCopy": true,
"validatePortraitSubstitution": false,
"validateDigitalManipulation": false,
"sreenReplayScore": 0.20818532,
"printedCopyScore": 2.725058,
"portraitSubstitutionScore": 0,
"digitalManipulationScore": 0,
"screenReplayProbability": 0.0008,
"printedCopyProbability": 0.0001,
"portraitSubstitutionProbability": 0,
"digitalManipulationProbability": 0,
"sreenReplayCalibration": "REGULAR",
"printedCopyCalibration": "REGULAR",
"portraitSubstitutionCalibration": "REGULAR",
"digitalManipulationCalibration": "REGULAR",
"ignoreDocumentCroppedValidation": false,
"ignoreColourLessValidation": false,
"screenReplayWarnings": ["GLARE_ON_IMAGE", "IMAGE_IS_TOO_COMPRESSED", "IMAGE_TOO_BLURRY"],
"printedCopyWarnings": ["GLARE_ON_IMAGE", "IMAGE_IS_TOO_COMPRESSED", "IMAGE_TOO_BLURRY"],
"portraitSubstitutionWarnings": [],
"digitalManipulationWarnings": [],
"screenReplayErrors": [],
"printedCopyErrors": [],
"portraitSubstitutionErrors": [],
"digitalManipulationErrors": [],
"aggregatedScore": 0.0004,
"isLive": false,
"aggregateWarnings": ["GLARE_ON_IMAGE", "IMAGE_IS_TOO_COMPRESSED", "IMAGE_TOO_BLURRY"],
"_id": "69001b0d3440483cbaae2d68",
"updatedAt": "2025-10-28T01:23:59.928Z",
"createdAt": "2025-10-28T01:23:59.928Z",
"__v": 0,
"chargesCount": 2,
"rawResponse": {
"pipeline_results": [
{
"pipeline_name": "screen-replay_2024-09",
"liveness_score": 0.20818532,
"liveness_probability": "0.0008",
"is_live": false,
"image_quality_warnings": ["GLARE_ON_IMAGE", "IMAGE_IS_TOO_COMPRESSED", "IMAGE_TOO_BLURRY"],
"status": "success"
},
{
"pipeline_name": "printed-copy_2024-09",
"liveness_score": 2.725058,
"liveness_probability": "0.0001",
"is_live": false,
"image_quality_warnings": ["GLARE_ON_IMAGE", "IMAGE_IS_TOO_COMPRESSED", "IMAGE_TOO_BLURRY"],
"status": "success"
}
],
"charges_count": 2,
"aggregate_liveness_probability": "0.0004",
"aggregate_is_live": false,
"aggregate_image_quality_warnings": ["GLARE_ON_IMAGE", "IMAGE_IS_TOO_COMPRESSED", "IMAGE_TOO_BLURRY"]
}
},
"signature": {
"dateTime": "October 28, 2025 1:24 AM",
"message": "Certified by Verifik.co"
},
"id": "8YISP"
}