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β
- Node.js
- Python
- PHP
- Go
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);
}
import http.client
import json
conn = http.client.HTTPSConnection("api.verifik.co")
payload = json.dumps({
"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
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
}
conn.request("POST", "/v2/document-liveness", 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/document-liveness', [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer <your_token>',
],
'json' => [
'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
]
]);
echo $response->getBody();
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.verifik.co/v2/document-liveness"
payload := map[string]interface{}{
"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,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <your_token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
Responseβ
- 200
- 400
- 413
{
"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"
}
{
"error": "Invalid image format",
"message": "INVALID_IMAGE_FORMAT"
}
{
"error": "Image too large",
"message": "IMAGE_TOO_LARGE"
}