Document Liveness

Passive liveness detection enhances security for person and/or document authentication solutions. It adds detection and alerting capabilities when a printed photo or digital image or a screenshot from monitor/TV is presented for identity authentication or physical access control workflows.

Features

  • Works with a single image of the identity document
  • Independent of document type
  • Helps prevent attacks that humans cannot detect
  • Reduces the time needed for human visual review and inspection
  • Requires no special capture-side software
  • Collects no OCR or identity data

Specifications

  • Image orientation: portrait or landscape
  • Minimum image size: 1080p
  • Supported documents: passports, ID cards, and driver’s licenses from all over the world
  • Allowed compression: maximum JPEG 70; prefer JPEG 90 or 100

API call

To perform a document liveness check.

This API currently supports basic authentication. All endpoints require an Authentication header in the following form:

Authorization: 'Basic ' + Base64.encode(username + ':' + password)

Send a HTTP POST request to:

  • /api/v1/document/liveness

The following parameters are used for requests and responses:

ParameterDirectionDescription
sessionIdrequestunique, short-lived code to be generated by the client to track specific sessions
frontSideImageBaserequestfront side document photo, Base64 format or URL link to it
backSideImageBaserequestback side document photo, Base64 format or URL link to it
sessionIdresponseunique, short-lived code to be generated by the client to track specific sessions. Same as in request
scoreresponsescore of the сheck. A higher score indicates a higher liveness level, with the default threshold set at 0.25. We recommend sending all scores in the range of 0.25 to 0.5 for manual review.
hasErrorresponseboolean parameter - true - verification process ended up with some error; false - no errors
errorresponseerror message in case of hasError set to true, informing about type of error: DOCUMENT_TOO_SMALL, DOCUMENT_CROPPED etc.
Request:
{
  "documentImageBase": "data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr
...
+SSyDCtmmrGoXzc8AcrURjKEjNOK6DII0ZyJFVgepUdKv26X0WVhuGcMPlBP3RVeFluDiNdvY8VbEUnO2UjaOTnrXoUZc8dTOdSUZEotL7A/eD/AL6oqVLJCoJmk6f3qKv2Rz+0if/Z",
  "sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84"
}

Response - passive liveness passed
{
  "sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
  "score": 0.9997104,
  "hasError": false
}

Response - passive liveness not passed:
{
"sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
"score": 0.002324,
"hasError": false
}


Response - error
{
  "sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
  "hasError": true,
  "error": "DOCUMENT_NOT_FOUND"
}

List of errors

ErrorMeaningDescription
DOCUMENT_TOO_CLOSE_TO_CAMERADocument is too close to the camera
DOCUMENT_TOO_CLOSE_TO_BORDERDocument is too close to the image border
DOCUMENT_PHOTO_NOT_FOUNDPortrait photo not detected on the document (valid for a front side only)
DOCUMENT_CROPPEDDocument is cropped (part of the document is not present in the image)
DOCUMENT_NOT_FOUNDDocument is not detected in the image
TOO_MANY_DOCUMENTSToo many documents were detected in the image
DOCUMENT_TOO_SMALLDocument size in the image is too small