Face match

Face match compares a live selfie against a reference image (for example the photo on an ID) and returns a cosine similarity plus a match flag. It requires the verify:facematch scope.

Match a selfie

Both images are base64-encoded. Pass a sessionId to attach the result to a verification session.

POST
/v1/verify/face-match
SELFIE=$(base64 -i selfie.jpg | tr -d '\n')
REFERENCE=$(base64 -i id-photo.jpg | tr -d '\n')

curl -X POST https://verify.lioncapventures.com/v1/verify/face-match \
  -H "Authorization: Bearer svk_live_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d "{\"selfie\":\"$SELFIE\",\"reference\":\"$REFERENCE\"}"
  • Name
    selfie
    Type
    string (required)
    Description

    Base64-encoded live selfie.

  • Name
    reference
    Type
    string (required)
    Description

    Base64-encoded reference image to compare against, such as an ID photo.

  • Name
    sessionId
    Type
    string
    Description

    Optional session this check belongs to.

Response

Response

{
  "match": true,
  "similarity": 0.913,
  "threshold": 0.62,
  "latencyMs": 168
}
  • Name
    match
    Type
    boolean
    Description

    Whether similarity cleared the threshold.

  • Name
    similarity
    Type
    number
    Description

    Cosine similarity from 0 to 1 between the two face embeddings. Higher means more alike.

  • Name
    threshold
    Type
    number
    Description

    The cut-off similarity was compared against. Provisional pending calibration.

  • Name
    latencyMs
    Type
    integer
    Description

    Server-side comparison time in milliseconds.

Combined verify

POST /v1/verify runs liveness on the selfie and face match against the reference in one call, so you get a presence check and an identity match together. It requires the verify:facematch scope.

POST
/v1/verify
curl -X POST https://verify.lioncapventures.com/v1/verify \
  -H "Authorization: Bearer svk_live_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d "{\"selfie\":\"$SELFIE\",\"reference\":\"$REFERENCE\"}"

Response

{
  "isLive": true,
  "livenessScore": 0.982,
  "faceMatch": true,
  "similarity": 0.913,
  "latencyMs": 342
}

Use combined verify when you have both images already and want a single round trip. Use a session when you want Sovera to host the capture and score the whole flow.

Was this page helpful?