Decrypt HumanID

Decrypt HumanID

Recover identity data by presenting the matching live face.

menu_bookAPI reference: Decrypt HumanIDexpand_more

Official guide: docs.verifik.co/functions/decrypt-zelfproof (request and response fields, optional password and verifier key, and example calls). Related: Create a ZelfProof, Create QR ZelfProof, Preview ZelfProof.

Base URL https://api.verifik.co. Send JSON with Content-Type: application/json and Authorization: Bearer <access token> (same JWT as this demo after sign in).

POST /v2/human-id/decrypt

Compares your face image to the proof, then returns decrypted public fields and related payload (for example face crop and difficulty) inside the usual signed data envelope when the match succeeds.

HeaderValue
Content-Typeapplication/json
AuthorizationBearer <token>
ParamReqDescription
faceBase64YesFace image as raw base64 (this demo uses the same format as other biometric demos)
osYesDESKTOP, IOS, or ANDROID (demo uses DESKTOP)
zelfProofYesHumanID string from paste, or from QR image extraction in this form
passwordNoOnly if the proof was created with a password
livenessLevelNoWhen set, aligns with server liveness expectations for decrypt (see official guide)
verifierKeyNoIf the proof was created with a verifier key
await fetch("https://api.verifik.co/v2/human-id/decrypt", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${accessToken}`,
  },
  body: JSON.stringify({
    faceBase64: "<base64>",
    os: "DESKTOP",
    zelfProof: "<human id string>",
  }),
});

POST /v2/human-id/preview-zelf-id-qr

Use this when the user provides a PNG or JPEG of the HumanID QR. The API reads the QR payload, runs the same kind of preview as a string preview, and returns a zelfProof you can pass into decrypt. Optional verifierKey applies when the proof was created with one. Same JSON headers as decrypt.

ParamReqDescription
zelfProofQRCodeYesImage as a data URL (data:image/png;base64,...) or another form accepted by the API (this demo builds a data URL from the file)
verifierKeyNoSame semantics as on decrypt when the proof uses a verifier key
await fetch("https://api.verifik.co/v2/human-id/preview-zelf-id-qr", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${accessToken}`,
  },
  body: JSON.stringify({
    zelfProofQRCode: "data:image/png;base64,<...>",
  }),
});
  • Decrypt uses decryptHumanId from @humanauthn/api-client. QR upload uses previewZelfIdQr first, then you decrypt with the returned proof string.
  • Success responses follow the Verifik pattern: a data object (and often a signature when signing is enabled for your project).
  • To inspect a proof without a face image, open the Preview HumanID demo (previewHumanId) or the Preview ZelfProof guide linked above.
menu_book

Official guides on docs.verifik.co