Skip to main content

Overview

The face comparison endpoints let you determine whether two base64-encoded images contain the same person. An optional liveness check can confirm the second image is of a live person (not a photo of a photo).

Face Compare

POST /Citizen/FaceCompare
Compares two face images and returns a match result with confidence score.
curl -X POST "https://citizen.uat.securecitizen.cloud/Citizen/FaceCompare" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "ConsentReceived": true,
    "Face1": "<base64_image_1>",
    "Face2": "<base64_image_2>",
    "CRef": "REF00001"
  }'

Request Fields

FieldTypeRequiredDescription
ConsentReceivedbooleanYesMust be true
Face1stringYesBase64-encoded first face image
Face2stringYesBase64-encoded second face image
CRefstringNoYour transaction reference

Response

{
  "isIdentical": true,
  "confidence": 0.98,
  "Status": "Success",
  "CRef": "REF00001"
}
FieldDescription
isIdenticaltrue if the two faces are determined to be the same person
confidenceConfidence score of the match (0–1, higher is more confident)

Face Compare with Liveness

POST /Citizen/FaceCompareWithLiveness
Compares two face images and runs a liveness check on the second image to confirm it is a live capture.
curl -X POST "https://citizen.uat.securecitizen.cloud/Citizen/FaceCompareWithLiveness" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "ConsentReceived": true,
    "Face1": "<base64_image_1>",
    "Face2": "<base64_selfie_with_liveness_data>",
    "CRef": "REF00001"
  }'

Response

{
  "isIdentical": true,
  "confidence": 0.98,
  "LivenessResult": {
    "LivenessResultScore": 1,
    "LivenessResultProbability": 0.85,
    "LivenessResultQuality": 0.9,
    "LivenessResultClass": false,
    "LivenessPassResult": true,
    "LivenessMessage": "Liveness check successful"
  },
  "Status": "Success",
  "CRef": "REF00001"
}

Liveness Result Fields

FieldDescription
LivenessResultScoreOverall liveness score
LivenessResultProbabilityProbability the image is of a live person (0–1)
LivenessResultQualityQuality score of the liveness capture (0–1)
LivenessResultClassfalse = live (real person), true = spoof detected
LivenessPassResulttrue if the liveness check passed
LivenessMessageHuman-readable result message
LivenessResultClass: false means the image is classified as a real live person — this is the desired passing state. A value of true indicates a potential spoof attempt.