API reference · v1

Integrate Veriface

Capture an ID document and a selfie in your own flow, send them from your server to /api/v1, and receive a decision. Results also arrive by webhook and appear in your dashboard.

Quickstart

Send the images as multipart form data. Each image can be JPEG, PNG, WebP or HEIC, up to 8 MB.

// Server-side only. Create a key in Dashboard → API keys.
const form = new FormData()
form.set("documentType", "drivers_license")
form.set("front", frontFile)
form.set("back", backFile)              // omit for "passport"
form.set("selfie", selfieFile)
form.set("userReference", "usr_8f31")   // optional: your own user id

const res = await fetch("https://veriface.hlhunt.org/api/v1/verifications", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.VERIFACE_API_KEY}` },
  body: form,
})
if (!res.ok) throw new Error((await res.json()).error.message)
const verification = await res.json()     // 201 Created

if (verification.status === "verified") unlockAccount()
else if (verification.status === "needs_review") queueForReview(verification.id)
else showRejection(verification.result.primaryReason?.message)  // or map .code to your own copy
curl https://veriface.hlhunt.org/api/v1/verifications \
  -H "Authorization: Bearer idv_live_..." \
  -F documentType=passport \
  -F front=@passport.jpg \
  -F selfie=@selfie.jpg \
  -F userReference=usr_8f31

Authentication & errors

  • Every v1 request needs Authorization: Bearer <key>. Keys are created and revoked in Dashboard → API keys; the secret is shown once. Never send keys from a browser or mobile app.
  • idv_live_ and idv_test_ keys behave the same and both count toward usage; use test keys to keep development traffic separate in the dashboard.
  • Each key may make 600 requests per minute. Every response carries RateLimit-* headers; a 429 includes Retry-After.
  • Errors share one shape. Codes: invalid_request (400), unauthorized (401), plan_limit_reached (402), account_suspended (403), not_found (404), document_not_accepted (422), rate_limited (429), internal_error (500), service_unavailable (503). A 503 means the verification engine is temporarily unavailable (model provider outage or quota); retry with backoff, nothing was recorded.
HTTP/1.1 402 Payment Required
Veriface-Request-Id: req_Yx2...           // quote this when contacting support
RateLimit-Limit: 600
RateLimit-Remaining: 597
RateLimit-Reset: 41

{
  "error": {
    "code": "plan_limit_reached",
    "message": "The Free plan includes 100 verifications per month. Upgrade to continue.",
    "request_id": "req_Yx2..."
  }
}

POST /api/v1/verifications

FieldTypeNotes
documentTypestringdrivers_license (Driver's license), state_id (State ID card), passport (Passport), passport_card (Passport card), residence_permit (Residence permit)
frontFileRequired. Front of the card or passport data page.
backFileRequired for every type except passport.
selfieFileRequired. Live, front-facing capture.
userReferencestringOptional, up to 120 characters. Your user id; filterable later.
expected[…]stringOptional. Values from your own form the ID must agree with: fullName, dateOfBirth, documentNumber, expirationDate, address. See Form validation.
sourcestringOptional. "sdk" when the capture came from your mobile SDK, otherwise "api".

Returns 201 with the verification object. Analysis typically completes in 5–15 seconds; set your HTTP client timeout to at least 60 seconds. Images are encrypted at rest and kept only for the workspace's retention period (Settings → Privacy; 30 days by default, or off), so reviewers can see what was analysed in the dashboard.

Embedding & returnUrl

You can show the capture page inside your own site instead of sending the person to /v/…. First list the origins that may embed it under Dashboard → Settings → Embedding (scheme and host, no path; http://localhost:PORT is accepted for development). Only those origins receive the framing headers below; everywhere else the page refuses to be framed.

If the page is shown on sites you can't list ahead of time (your form embedded on each of your own customers' websites), pass embedOrigins when you create the link: up to 10 origins, same format, that may embed that one link in addition to the Settings list. Browsers check every page above the frame, so include each one: the outer site and any frame of yours in between (["https://merchant-site.com", "https://app.example.com"]). Other links are not affected.

  • Content-Security-Policy: frame-ancestors 'self' https://app.example.com and Permissions-Policy: camera=(self "https://app.example.com"), microphone=(), geolocation=() are computed per link from its workspace's list plus the link's own embedOrigins. The capture flow sets no cookies, so it works in third-party iframes on iOS Safari and Android Chrome.
  • Put allow="camera; fullscreen" on the iframe or the browser blocks the camera. Add ?embed=1 to the link for the compact layout from the first paint (it is also detected automatically); a 420×720 frame fits phones and desktops without horizontal scroll.
  • When capture completes, fails or is cancelled the page posts one message to the embedding window. The target is the single allowed origin matching your page (from the referrer, or an ?origin= parameter you add to the link); nothing is posted to origins that are neither on your list nor in the link's embedOrigins.
  • returnUrl (optional on POST /api/v1/verification-links; https, or http on localhost) is used when the page is not embedded: after capture the person is sent there with linkId, verificationId and status appended as query parameters. Treat those as a hint and fetch the link from your server for the real outcome.
<!-- Your page on an allowed origin, e.g. https://app.example.com -->
<iframe
  src="https://veriface.hlhunt.org/v/Xk2...?embed=1"
  allow="camera; fullscreen"
  style="width: 420px; max-width: 100%; height: 720px; border: 0; border-radius: 16px"
></iframe>

<script>
window.addEventListener("message", (event) => {
  if (event.origin !== "https://veriface.hlhunt.org") return
  const msg = event.data
  if (!msg || msg.source !== "veriface") return
  // msg.type: "verification.completed" | "verification.failed" | "verification.cancelled"
  // msg: { source: "veriface", type, linkId: "cap_…", verificationId: "ver_…" | null,
  //        status: "verified" | "needs_review" | "rejected" | "failed" | "cancelled" }
  // Confirm server-side: GET /api/v1/verification-links/{msg.linkId}
})
</script>

// Not embedded: with returnUrl set, after capture the person lands on
https://app.example.com/kyc/done?linkId=cap_3k9d…&verificationId=ver_7c0e…&status=verified

Form validation

If the person already typed their details into your sign-up or checkout form, pass them as expected and Veriface checks the ID against them, preferring the back-of-card barcode (machine-written) over the front OCR when it was decoded, so a typo on your form is caught against the authoritative value. Names are compared on first and last name (case, accents, punctuation and middle names are ignored, and "Last, First" is accepted); dates in any common format; document numbers ignoring spaces and dashes. A mismatch sets checks.detailsMatchForm to false and moves the verification to needs_review with a user-facing reason; a field that couldn't be read from the ID is reported as match: null and doesn't fail the check. result.validation lists every field side by side (front OCR, barcode, form) with its outcome, which is what the dashboard's Data validator shows.

// Multipart: one field per value you collected on your own form…
form.set("expected[fullName]", "Jane M. Sample")
form.set("expected[dateOfBirth]", "1990-04-12")        // any common date format
form.set("expected[documentNumber]", "D1234568")
form.set("expected[address]", "1234 Any Street, Sacramento CA 95814")

// …or a single JSON field
form.set("expected", JSON.stringify({ fullName: "Jane M. Sample", dateOfBirth: "04/12/1990" }))

// Phone links take the same object
POST /api/v1/verification-links  { "userReference": "usr_8f31", "expected": { "fullName": "Jane M. Sample" } }

// The verification then carries the comparison
"checks": { ..., "detailsMatchForm": false },
"result": {
  "formMatch": {
    "allMatch": false,
    "mismatches": ["dateOfBirth"],
    "fields": {
      "fullName":    { "expected": "Jane M. Sample", "extracted": "JANE MARIE SAMPLE", "match": true },
      "dateOfBirth": { "expected": "1990-04-12",     "extracted": "1991-04-12",        "match": false }
    }
  },
  "validation": {                     // every field, side by side
    "consistent": false,
    "mismatches": ["dateOfBirth"],
    "fields": [
      { "key": "fullName",    "front": "JANE MARIE SAMPLE", "barcode": "JANE MARIE SAMPLE", "form": "Jane M. Sample",
        "frontVsBarcode": true,  "formVsId": true,  "status": "consistent" },
      { "key": "dateOfBirth", "front": "1990-04-12",        "barcode": "1990-04-12",        "form": "1991-04-12",
        "frontVsBarcode": true,  "formVsId": false, "status": "mismatch" }
    ]
  },
  "reasons": ["The date of birth on the ID doesn't match the date of birth you entered."],
  "reasonDetails": [{ "code": "dob_mismatch", "message": "The date of birth on the ID doesn't match the date of birth you entered." }],
  "primaryReason": { "code": "dob_mismatch", "message": "The date of birth on the ID doesn't match the date of birth you entered." }
}

Barcode cross-check

North American driver's licenses and state IDs carry a PDF417 barcode on the back with the holder's data. When a back image is supplied, Veriface decodes it and compares name, date of birth, document number and expiration date with what was read from the front. A different document number or date of birth is treated as a tampering signal and the verification is rejected; a name-only difference goes to needs_review. An unreadable barcode (glare, blur, HEIC uploads) is noted but never fails a verification. Passports have no barcode and are skipped.

"checks": { ..., "barcodeMatchesFront": true },
"result": {
  "barcode": {
    "read": true,                 // a PDF417 barcode was found and decoded
    "aamva": true,                // it follows the driver's license (AAMVA) layout
    "matchesFront": true,         // null when nothing could be compared
    "mismatches": [],             // e.g. ["document number", "date of birth"]
    "fields": {
      "fullName": "JANE MARIE SAMPLE", "dateOfBirth": "1990-04-12", "documentNumber": "D1234568",
      "expirationDate": "2030-04-12", "issuingJurisdiction": "CA", "address": "1234 ANY STREET, SACRAMENTO, CA, 95814"
    },
    "note": null                  // set when the barcode is missing, unreadable or not AAMVA
  }
}

Verification object

{
  "id": "ver_7c0e3d41a9f24b0e8d11",
  "orgId": "org_x1y2z3",
  "status": "verified",              // "verified" | "needs_review" | "rejected"
  "documentType": "drivers_license",
  "source": "api",                   // "api" | "sdk" | "link" | "live"
  "userReference": "usr_8f31",       // who it was for: your user id / email (set it on every request)
  "initiatedBy": "api_key:key_9x2...", // team member email, api_key:<id>, or the link creator
  "durationMs": 8421,
  "createdAt": "2026-10-14T15:02:11.000Z",
  "reviewedAt": null,               // set when someone reviews it manually
  "result": {
    "id": "ver_7c0e3d41a9f24b0e8d11",
    "status": "verified",
    "documentType": "drivers_license",
    "checks": {
      "documentAuthentic": true, "documentReadable": true, "documentTypeMatches": true,
      "documentNotExpired": true, "faceMatch": true, "selfieLive": true
    },
    "scores": { "authenticity": 0.97, "faceMatch": 0.93 },
    "extracted": {
      "fullName": "Jane Sample", "dateOfBirth": "1990-04-12", "documentNumber": "S1234567",
      "expirationDate": "2030-04-12", "issuingAuthority": "California"
    },
    "barcode": { ... },             // see Barcode cross-check (drivers_license / state_id)
    "formMatch": { ... },           // see Form validation (only when expected was sent)
    "reasons": [],                  // applicant-facing messages, primary first (empty when verified)
    "reasonDetails": [],            // [{ "code": "dob_mismatch", "message": "..." }], same order as reasons
    "primaryReason": null,          // the first thing the applicant should fix, or null
    "reviewNotes": [],              // staff-only notes and scores; don't show to applicants
    "completedAt": "2026-10-14T15:02:11.000Z"
  }
}

When workspace redaction is enabled, document numbers are masked in the dashboard only; the API always returns the full value to your server.

Newer verifications also carry result.evidence: the raw signals behind the checks (detected document type, government-issued, tampering, screen or copy, front/back consistency, face count and the face-match reasoning), the thresholds in force when it was decided, and approximate regions ([x, y, w, h] as fractions of the image) of the fields the model located. Phone-link and dashboard captures add evidence.client with the capturing browser's user agent and IP. The dashboard's evidence viewer is built from these fields; treat them as optional, since older verifications don't have them.

Reasons & codes

Every failed check produces exactly one reason, grouped by what the applicant has to fix, so a single wrong photo gives one reason rather than several. result.reasonDetails lists them as { code, message }, ordered so the first is the one to fix first; result.primaryReason is that first entry (or null when nothing failed) and result.reasons holds the same messages as plain strings.

Messages are written for the applicant and safe to show as-is. To use your own wording, branch on code: codes are stable and new ones may be added, so keep a fallback to message. Name, date of birth and other form fields are reported as separate codes. Model observations and scores (for example the authenticity score against its threshold) go to result.reviewNotes, which is for your staff and should not be shown to applicants. Verifications made before codes existed are explained from their stored checks when you fetch them.

  • document_screen_or_copy — Screen image or copy
  • document_not_found — No ID found
  • document_type_mismatch — Wrong document type
  • image_quality — ID photo unclear
  • document_front_back_mismatch — Front and back don't match
  • document_expired — Document expired
  • selfie_no_face — No face in selfie
  • selfie_multiple_faces — Several faces in selfie
  • selfie_not_live — Selfie not live
  • name_mismatch — Name mismatch
  • dob_mismatch — Date of birth mismatch
  • document_number_mismatch — Document number mismatch
  • expiration_date_mismatch — Expiration date mismatch
  • address_mismatch — Address mismatch
  • details_mismatch — Details mismatch
  • barcode_mismatch — Barcode doesn't match front
  • face_mismatch — Selfie doesn't match ID
  • document_tampered — Possible alteration
  • document_authenticity — Authenticity not confirmed

List & retrieve

Results are newest first and cursor-paginated (limit 1–100, default 20). Filters: status, document_type, user_reference.

GET /api/v1/verifications?limit=20&status=needs_review&document_type=passport
GET /api/v1/verifications?user_reference=usr_8f31
GET /api/v1/verifications?starting_after=ver_7c0e3d41a9f24b0e8d11   // next page
GET /api/v1/verifications/:id

{
  "object": "list",
  "data": [ { ...verification }, ... ],
  "has_more": true,
  "next_cursor": "ver_51b2..."     // pass as starting_after
}

Manual review

Record a decision for a session in needs_review (or override any outcome). This fires the verification.reviewed webhook and is written to your audit trail.

PATCH /api/v1/verifications/:id
Content-Type: application/json

{ "status": "verified" }   // or "rejected" / "needs_review"

GET /api/v1/stats

Aggregates for the last days (1–90, default 14). Values are cached for up to 10 seconds, so polling is cheap.

GET /api/v1/stats?days=30

{
  "total": 1284, "verified": 1102, "needsReview": 97, "rejected": 85, "passRate": 0.858,
  "avgDurationMs": 8710,
  "durations": { "p50": 8100, "p95": 13900, "buckets": [ ... ] },
  "byDocumentType": [ { "type": "drivers_license", "count": 811 }, ... ],
  "daily": [ { "date": "2026-10-01", "verified": 41, "needsReview": 3, "rejected": 2 }, ... ],
  "topReasons": [ { "reason": "...", "count": 31 } ]
}

Webhooks

Configure one endpoint per workspace in Dashboard → Webhooks and choose which events to receive:

  • verification.completed — Fires when automated checks finish, including results that need manual review.
  • verification.needs_review — Fires when a session lands in the manual review queue.
  • verification.reviewed — Fires when a reviewer approves, rejects, or reopens a session. Subscribe to keep review decisions synchronized.
  • api_key.created — Fires when a new API key is issued.

Deliveries are signed with your endpoint secret (HMAC-SHA256 over ${timestamp}.${body}) and time out after 10 seconds. Respond with any 2xx status. Every attempt and its response code is listed in the dashboard.

POST https://your-server.example.com/webhooks/veriface
Veriface-Signature: t=1760540531,v1=5f2b...

{ "id": "evt_...", "type": "verification.completed", "created": "2026-10-15T14:22:11Z", "data": { ...verification } }

// Verify (Node.js) — use the raw request body
const [t, v1] = header.split(",").map((p) => p.split("=")[1])
const expected = crypto.createHmac("sha256", process.env.VERIFACE_WEBHOOK_SECRET)
  .update(`${t}.${rawBody}`).digest("hex")
const valid = crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected))
  && Math.abs(Date.now() / 1000 - Number(t)) < 300   // reject replays older than 5 min

Decision logic

needs_review means automated checks have finished and a human decision is required, not that processing is still running. Show the applicant result.primaryReason (or result.reasons) and retain result.checks, result.scores, and result.evidence.thresholds to explain the result using the thresholds recorded at verification time. Older results may not contain evidence. A manual decision updates the status and reviewedAt while preserving the original checks and scores. Subscribe to verification.reviewed to receive that decision, or fetch the verification again.

Defaults are shown below. Each workspace can change the thresholds and accepted document types in Dashboard → Settings, and they apply to the next verification.

  • rejected when the document is not government issued, shows tampering or is a photo of a screen, is expired, the selfie fails liveness, or the face match score is below 0.55.
  • needs_review when no hard failure applies but at least one check doesn't pass, for example a face match between 0.55 and 0.75, unreadable text, a document that doesn't match the selected type, or authenticity below 0.70.
  • verified when every check passes: face match at least 0.75 and document authenticity at least 0.70.

Dashboard capture

Team members can also start a verification from the browser (Dashboard → Verifications → New verification). On a computer it shows a QR code to continue on a phone and updates live as the phone progresses; the result is stored with source: "link". "Use this device's camera instead" (and any phone or tablet) runs the capture in the same browser, recorded with source: "live".