Skip to content

Verify API

Base URL: https://hakim-verify-api.vercel.app

Key Where it goes Allows
Publishable pk_… in the page, in the box’s endpoint starting sessions and polling results for your tenant
Secret sk_… your server only reading and cancelling your tenant’s results
Method and path Caller Purpose
POST /v1/<pk>/new the box start a session → { id, deepLink, expiresAt, linkHost, requested, … }; body {}, or { "supersedes": "<id>" } when the box reloads an expired QR
GET /v1/<pk>/session/:id the box hand-off details again; 410 once expired
GET /v1/<pk>/result/:id the box current state
POST /v1/<pk>/close/:id wallet the holder dismissed the request
POST /v1/<pk>/dcapi/:id the box Digital Credentials API response
GET /v1/<pk>/request/:id wallet the signed request
POST /v1/<pk>/response/:id wallet the presentation
GET /v1/results/:id your server, Authorization: Bearer sk_… the outcome
DELETE /v1/results/:id your server, Authorization: Bearer sk_… cancel a session

Page-facing routes answer CORS preflight for the origins on your tenant’s allowed list.

Configured per tenant: the name the wallet shows, the request (one or several documents and their fields), the trusted issuers, allowed origins, the request validity window (ten minutes by default), the wallet hand-off settings, and optionally your own reader certificate. Results are stored per tenant; a secret key only reads its own.

Every session (POST …/new, GET …/session/:id) carries requested: exactly what the wallet is asked for, document by document, field by field, in request order (the order the wallet’s consent lists them), with the name each field has on the consent screen. The box lists these rows, and only these (What the box lists).

"requested": [
{ "id": "credential", "docType": "org.iso.18013.5.1.mDL", "label": "Driving license",
"claims": [ { "namespace": "org.iso.18013.5.1", "element": "family_name", "label": "Family name" },
{ "namespace": "org.iso.18013.5.1", "element": "portrait", "label": "Photo of holder" } ] }
]

Standard fields (driving licence, ISO 23220 Photo ID) carry the names standard wallets show; your tenant sets the name of any other field, or of one your holders’ wallet names differently.

{ "state": "verified", "verified": true, "docType": "org.iso.23220.photoid.1", "trustedChain": 2,
"claims": { "family_name": "…", "portrait": "data:image/jpeg;base64,…" }, "namespaces": { "…": {} },
"documents": { "credential": { "id": "credential", "docType": "org.iso.23220.photoid.1", "trustedChain": 2,
"claims": { "…": "…" }, "namespaces": { "…": {} } } } }
{ "state": "failed", "verified": false, "error": "…" }
{ "state": "waiting", "expiresAt": 1790870475314 } // also: cancelled, expired

documents holds every document the wallet presented, by its id in your tenant’s request (credential when the request has one document). docType, trustedChain, claims and namespaces repeat the first document, so a one-document site reads them as before. With several documents, read each from documents (Ask for several documents).

expiresAt is in milliseconds since 1970, on a new session and while it waits, so a page can show a countdown.

  • An expired session can never be approved (410); unknown ids read as expired.
  • A second submission returns the first outcome.
  • A late close never overrides a result.

Every state and error value is listed in Errors and states.