Skip to main content
POST
Python
The ID Liveness API section allows users to verify the authenticity of an ID document by analyzing the provided image for signs of tampering or forgery. Users can leverage different pipelines to detect screen captures, printed copies, and portrait replacements, ensuring the integrity of the ID document. Upon completion, users will receive recognition results and transaction information, facilitating secure identity verification processes.
Notes
To properly verify the authenticity of an image, whitespace around the ID is required.
If the ID fills the entire image without any whitespace, accurate results may not be produced.
Example image:

Request notes

  • Set idImage to the bytes of the image file encoded as a base64 string. Send only the encoded string, without a prefix such as data:image/png;base64,.
  • sr, pc, and ps in pipelines are all required and must be boolean values.
  • If you include callbackUrl, the request is processed asynchronously and the result is delivered to that URL. To receive the result directly in the response, omit callbackUrl.
  • When testing in the playground, paste the same base64 string into the idImage field.

Response Attributes

string
Unique identifier for the transaction associated with the recognition request.
string
Returns detection scores for each pipelines.Pipelines Values:
  • screenReplay - liveness_score
  • paperPrinted - liveness_score
  • replacePortraits - liveness_score
string
Identifies the specific error for troubleshooting.Error Code Values:
  • 1001 - Workspace is unavailable
  • 1003 - Fail to process data
  • 1005 - idImage is required
  • 1007 - pipelines is required
  • 1008 - invalid pipelines format
  • 1009 - Fail to analyze document
  • 1010 - callbackUrl is required
string
Briefly describes the error. Please refer to the error code for details.

Authorizations

x-api-key
string
header
required

Body

application/json
idImage
string
required

The ID document image to analyze for liveness detection, as a base64-encoded string. Encode the bytes of the image file and send only the encoded string, without a data URI prefix such as data:image/png;base64,. The image should contain a clear view of the ID document.

pipelines
object
required

Forgery detection options object

useUpcomingVersion
boolean
default:false

Use the upcoming version of the liveness engine

callbackUrl
string<uri>

Optional callback URL where the liveness detection results will be sent upon completion. If provided, the process works asynchronously.

Example:

"https://your-domain.com/callback"

Response

Successful liveness detection analysis

apiType
string
Example:

"id_live_doc"

transactionId
string

Unique transaction identifier

Example:

"txn_123456789"

engineVersion
string

Liveness Engine's version for each request

Example:

"id_liveness@3.4.2"

result
object