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.
| Header | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
| Param | Req | Description |
|---|---|---|
| faceBase64 | Yes | Face image as raw base64 (this demo uses the same format as other biometric demos) |
| os | Yes | DESKTOP, IOS, or ANDROID (demo uses DESKTOP) |
| zelfProof | Yes | HumanID string from paste, or from QR image extraction in this form |
| password | No | Only if the proof was created with a password |
| livenessLevel | No | When set, aligns with server liveness expectations for decrypt (see official guide) |
| verifierKey | No | If 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.
| Param | Req | Description |
|---|---|---|
| zelfProofQRCode | Yes | Image as a data URL (data:image/png;base64,...) or another form accepted by the API (this demo builds a data URL from the file) |
| verifierKey | No | Same 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
decryptHumanIdfrom@humanauthn/api-client. QR upload usespreviewZelfIdQrfirst, then you decrypt with the returned proof string. - Success responses follow the Verifik pattern: a
dataobject (and often asignaturewhen 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.
Related documentation
Official guides on docs.verifik.co
Decrypt a ZelfProof
Unlock the identity payload inside a proof by matching it to a live face. Covers optional password when the proof was created with one.
Create a ZelfProof
Encrypt your public fields and face capture into a new HumanID string you can store or share.
Preview ZelfProof
Inspect public metadata and what will be required before you decrypt, without sending a face image. The Preview HumanID demo follows the same idea on the current API.
Create QR ZelfProof
Generate a QR that embeds a HumanID so people can scan it from a screen or wallet.
Liveness detection
Run a dedicated check that a face image looks live rather than spoofed. This is separate from HumanID encrypt and decrypt.