Skip to main content

Encrypt HumanID

Endpoint

POST https://api.verifik.co/v2/zelf-proof/encrypt

Creates a HumanID (verifiable credential) by encrypting metadata of any kind and storing it in IPFS, a decentralized alternative to conventional cloud solutions (AWS, Azure, Google Cloud). Each HumanID can later be verified by the owner without storing the owner's biometric data.

Headers

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Params

NameTypeRequiredDescription
faceBase64stringYesBase64 encoded facial image
requireLivenessbooleanYesWhether to require liveness detection
livenessLevelstringYesLiveness detection level (REGULAR, SOFT, HARDENED)
osstringYesOperating system (DESKTOP, ANDROID, IOS)
identifierstringYesUnique identifier (alphanumeric only, no spaces or special characters)
publicDataobjectYesPublic data to be stored with the proof (string key-value pairs)
metadataobjectYesPrivate metadata (string key-value pairs)
passwordstringNoOptional password for additional security
referenceFaceBase64stringNoReference face for comparison
tolerancestringNoTolerance level (REGULAR, SOFT, HARDENED)
verifierKeystringNoVerifier key for additional validation
livenessDetectionPriorCreationbooleanNoEnable liveness detection before proof creation

Request

const fetch = require("node-fetch");

async function run() {
const res = await fetch("https://api.verifik.co/v2/zelf-proof/encrypt", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
faceBase64: "<base64_image>",
requireLiveness: false,
livenessLevel: "REGULAR",
password: "1234",
os: "DESKTOP",
identifier: "randomid",
publicData: {
"a": "1",
"b": "2",
"vida": "true"
},
metadata: {
"secretA": "3",
"secretB": "sijfoidjfijdifj"
}
}),
});
console.log(await res.json());
}

run();

Response

{
"data": {
"zelfProof": "A39T6XGv2ld+/lwCeB11tcXKFUE2+4LkYwr2BfVwko8OvAqFCavD2S5o62IsxIH8QuQ6K9z1yJ6qhedWojVAhlMoufcpZLlhSknJTUMsql+FXXECoZ0elw3ZCKm1DHrrn3QoRtv3Pfc1EPB2fSoXan2RjFEnkolmrNA/FvRaEOgPeFLUlOFAVzYRVVsoFfe9N6pNZ9q5uCRti7vUwPz5LnObB5uVxFyNZFxZJKrJmqkEHWI+elEqQR/7KnGtwgyN4TNnVGdbyRUUZ8eTztGal5VHIDwYdKxIbjDb1x+xz/elCShcHr4K2QhG+cefp1hj6GFg8BSLF83Wk5U20Cm5V6G0F3Vjk4yNDc7IQB6OfvEDsD8OEov4xBG51D7pw6ukFrw/FrlHBbR+KV6We8t7pJ5/vzFll1tZKcki4PoOXcu/DzmhEVVb0DoVRcB53sbxpU0G5aT0hRH2rhs1jI0yitSzISqFOTNCb7wm3CQoA2ZGndx4+DLaoKjOb/9RFlRyk2FWpM1QGAPGMbJbDeW1JrZmBTsWQ6vTr6U+JdCZA2ZxEXIsugpzbkbMMnisW8m+ddoYJm2TJTvYI8XX6bLtC6T6dEM0oFPbJkjcYdW6bemsaMm0+evZUdREs7E435jDXEoJEP0LOufTluGYcstrTqcwKtSwM5OKK9qH27WNaWcybYrKw8tA0RBUf1jDc8ChHiKXRtiUQ3JxKzK2qLnlpBYLo/0Kyy0tYP7xK1lhxaJvMks8igH/jOuyjqLL0MmOs9EnCGZayJD/UQcu84XgDQKmVxk2zFUVhol7HlcRgpMisVaSawWhpnZtPFAeV+rpJgYAR8g4NjhZ7d9QGuHTdrxmGhHZcEyTqblMx4Kx4UVdWKzvHgaFjFFYag2w",
"ipfs": {
"url": "https://blush-selective-earwig-920.mypinata.cloud/ipfs/bafkreibu6ouy66tv7mmqbf4rxjd2tywdhfad2vri2sk562bltuz663imwu",
"IpfsHash": "bafkreibu6ouy66tv7mmqbf4rxjd2tywdhfad2vri2sk562bltuz663imwu",
"PinSize": 965,
"Timestamp": "2025-10-15T15:22:00.333Z",
"ID": "8e4dd38b-580d-4bf7-a71d-5c6d4e7dc008",
"Name": "613375a1eab2fe08527f81e2_zk_randomid_93558.json",
"NumberOfFiles": 1,
"MimeType": "application/json",
"GroupId": "861b93d7-9795-461d-b479-31f751d6869e",
"pinned": true,
"web3": true,
"name": "613375a1eab2fe08527f81e2_zk_randomid_93558.json",
"metadata": [
"a",
"b",
"vida"
]
}
},
"credits": {
"amount": -0.84,
"status": "approved",
"category": "usage",
"client": "613375a1eab2fe08527f81e2",
"superAdmin": null,
"expensesGroup": "613375a1eab2fe08527f81e2_zk_randomid_93558",
"group": "Zelf",
"product": "other",
"code": "zelf-proofs",
"transaction": null,
"expiresAt": null,
"isExpired": false,
"referenceCredit": null,
"_id": "68efbc187fb658e0366a3019",
"updatedAt": "2025-10-15T15:22:00.907Z",
"createdAt": "2025-10-15T15:22:00.907Z",
"__v": 0
}
}

Notes

  • The HumanID token contains encrypted HumanData, raw metadata only accessible to the owner of the HumanID.
  • IPFS data includes metadata about the stored HumanID and public data keys
  • Credits are deducted for HumanID creation (typically 0.84 credits)
  • The identifier must be alphanumeric only (no spaces or special characters)
  • publicData and metadata must contain only string key-value pairs
  • Liveness detection can be enabled for biometric security
  • Password protection adds an extra layer and is an option that can be included in the security of the HumanID