Facededup Developers
Facededup API · v1

Prove a real person is present, then check who they are.

Facededup runs liveness and anti-spoofing on the device and on our servers, then lets you match the live face against NIN, BVN, a document or an enrolled face. Drop in an SDK for capture, verify the signed result on your server, and you're done.

Products

ProductWhat it answersEndpoints
LivenessIs a live human physically in front of the camera, right now?/v1/verify and its setup calls
IdentityDoes this face match the NIN or BVN record?/v1/identity/verify, /search
DocumentsIs the passport or ID valid, and is it this person?/v1/document/mrz, /verify
Face enrollmentIs this the same person who enrolled before, and have we seen this face under another account?/v1/face/enroll, /authenticate, /dedup
AddressWas the person at the address they declared?/v1/address/verify

Base URL for every request: https://facededup.ai. All requests and responses are JSON over HTTPS, and images are sent as base64-encoded JPEG or PNG.

Get started

Quickstart

Each step is one call and the response you should see. Use your sandbox key throughout.

  1. Get your keys

    Your Facededup account team issues a sandbox key (starts with fdk_test_) and a live key. Store them as a secret on your server, for example in an environment variable called FACEDEDUP_KEY. Never ship the live key inside a mobile app's source.

  2. Say hello

    Confirm you can reach the API. This call needs no key.

  3. Check your key

    Any call that needs a key returns 401 when the key is missing or unknown. Reading your webhook settings is a safe first authenticated call, and the response names your tenant.

  4. Run a liveness check

    Drop the capture UI into your page. It handles the camera, the head-movement challenges and the API calls, then gives you the result.

    checkout.html · web SDK
    import { mountLiveness } from "@facededup/liveness-web";
    
    mountLiveness(document.getElementById("kyc"), {
      baseUrl: "https://facededup.ai",
      licenseKey: "fdk_test_…",       // sandbox key
      subjectId: "user_8231",          // your ID for this person
      onResult: async (r) => {
        // r.outcome: "live" | "not_live" | "referred"
        // Send the signed token to YOUR server; don't trust r.outcome alone.
        await fetch("/kyc/liveness", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ token: r.signed_result?.token }),
        });
      },
    });

    Using a mobile app? See React Native, Flutter, Android or iOS.

  5. Confirm the result on your server

    Redeem the token with your key. It's valid for 120 seconds and can be redeemed once, so a captured token can't be replayed. Only grant access when payload.outcome is "live".

Get started

Authentication

Send your key in the X-License-Key header on every request. The key decides which tenant the call belongs to, so a tenant_id in the request body is ignored whenever a key is present.

A WebView that can't set headers may pass the key as a query parameter instead: ?license=fdk_…. Prefer the header everywhere else, because query strings end up in logs.

Keep live keys on your server. Mobile and web SDKs need a key to start a session. Use your sandbox key while building, and talk to your account team about the licence certificate used by the mobile SDKs in production.
Header
X-License-Key: fdk_test_4f1c…
Missing or unknown key · GET /v1/webhook
401 Unauthorized
{ "detail": "a license key is required to configure webhooks" }
Get started

Sandbox & live

Sandbox and live use the same base URL. The key decides the environment: a key beginning fdk_test_ (or sk_test_) marks the call as sandbox, and any other valid key is live. Sandbox calls run the full liveness engine, so test with real people and real devices, not photos.

SandboxLive
Key prefixfdk_test_fdk_ (no test)
Base URLhttps://facededup.ai
DecisionsTagged sandbox in your recordsTagged production
Guides

How a liveness check works

The SDKs make these calls for you. Call them yourself only if you build your own capture. They must happen in this order, and all of them share one request_id.

1 · consentThe person agrees to biometric processing.
2 · requestOpens a check and sets the risk level.
3 · challengeRandom actions and a nonce, valid for 20 s.
4 · verifyFrames go in; a verdict and signed token come out.
5 · redeemYour server confirms the token, once, within 120 s.
StepCallerCallReturns
1SDKPOST /v1/consentconsent_id
2SDKPOST /v1/requestrequest_id
3SDKPOST /v1/challengeactions and nonce, valid 20 s
4SDKPOST /v1/verify with framesoutcome and signed_result.token
5Your serverPOST /v1/result/redeemvalid and the outcome

What we check

On the device, the SDK coaches positioning, confirms each action and looks for screen replays. On our servers, we re-check the actions in the frames you send, look for print, screen and injected-video attacks, and, on supported iPhones, require real 3D depth from the TrueDepth camera. Every decision is written to a tamper-evident, hash-chained audit log.

Guides

Trusting results on your server

A result that passes through the browser or app can be edited. Every /v1/verify response therefore carries signed_result.token, an Ed25519-signed statement of the outcome. Confirm it on your server in one of two ways.

Option A · redeem (recommended)

Send the token to POST /v1/result/redeem. We check the signature and expiry, and enforce single use, so a stolen token is useless after its first redemption.

Option B · verify offline

Fetch our public key once from GET /v1/result/public-key and verify the signature yourself. This works without a network call per check, but it can't enforce single use, so record redeemed decision_ids on your side.

The token is base64url-encoded JSON: {"payload": {…}, "sig": "…"}. The signature covers the payload serialised with sorted keys and no spaces.

Decoded token payload
signed_result.token → payload
{
  "request_id": "9f0c4c1e-6a1d-4f7e-9d0b-2a5c8e1f3b77",
  "decision_id": "d3b7a2e4-1c5f-4a8e-b6d9-7e2f0c1a9b44",
  "subject_id": "user_8231",
  "outcome": "live",
  "score": 0.9132,
  "threshold_version": "2026-06-07.1",
  "issued_at": "2026-11-25T10:42:07Z",
  "expires_at": "2026-11-25T10:44:07Z",
  "single_use": true
}
Mobile SDKs. The Android and iOS SDKs return the full result as payload_json, or as encrypted_payload when your account uses tenant encryption. Only your private key can decrypt it.
Guides

Webhooks

Register one HTTPS endpoint per tenant with POST /v1/webhook. The response includes a signing secret (whsec_…) that's shown once, so store it straight away.

Webhooks are sent for checks submitted through offline capture, where the verdict arrives after the person has left. For live checks, use the response from /v1/verify directly.

Verify every delivery

Each POST carries X-Facededup-Signature: sha256=<hex>, the HMAC-SHA256 of the raw request body using your secret. Compute it over the exact bytes you received, before parsing the JSON, and compare in constant time. We time out after 8 seconds, so acknowledge quickly and do slow work afterwards.

Event payload
POST to your endpoint · liveness.decision
{
  "event": "liveness.decision",
  "client_txn_id": "agent-07-000412",
  "decision_id": "d3b7a2e4-1c5f-4a8e-b6d9-7e2f0c1a9b44",
  "subject_id": "user_8231",
  "outcome": "live",
  "is_live": true,
  "score": 0.9132,
  "threshold": 0.6,
  "tenant": "acme",
  "captured_at": "2026-11-25T09:58:11Z",
  "submitted_at": "2026-11-25T10:42:07Z",
  "offline": true,
  "metadata": { "branch": "Ikeja" }
}
Verify the signature · Node.js
import crypto from "node:crypto";

// rawBody: the exact bytes received (Buffer), before JSON.parse
function isFromFacededup(rawBody, header, secret) {
  const expected = "sha256=" + crypto
    .createHmac("sha256", secret).update(rawBody).digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(header || "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
Guides

Outcomes & score bands

Liveness outcome

outcomeMeaningWhat to do
liveA live person completed the challenge and passed every anti-spoofing check.Continue, after you've confirmed the token.
not_liveLiveness wasn't proven: a likely spoof, a failed challenge, or a borderline score.Let the person retry with better light and a steadier phone, up to max_attempts.
referredSent to a human: attempts ran out, or you used the assisted route.Hold the account and wait for a review decision.

score is a number from 0 to 1. The threshold is 0.6 at baseline risk and 0.8 at stepup.

Face match bands (identity, documents, enrollment)

match_score runs from 0 to 100.

Send refer results to a person for manual review rather than rejecting them outright.

SDKs

Web

@facededup/liveness-web 0.2.2. A drop-in capture UI with on-device face tracking, plus a headless client if you want to build your own UI. Requires HTTPS (or localhost), camera permission, and a click before capture starts. The built-in Start button provides that click.

Useful options: brandColor, language (en or pcm), showBranding, onError.

Install
npm i https://swiftend-assets-348761024048.s3.eu-west-2.amazonaws.com/sdk/npm/facededup-liveness-web-0.2.2.tgz
React
import { FacededupLiveness } from "@facededup/liveness-web/react";

<FacededupLiveness
  baseUrl="https://facededup.ai"
  licenseKey={KEY}
  subjectId={userId}
  onResult={(r) => (r.is_live ? next(r) : retry(r))}
/>
SDKs

React Native

@facededup/liveness-react-native 2.0.0-beta.66, wrapping the native SDK 2.0.0-beta.62. Runs the full native capture flow with no WebView, on React Native 0.74 to 0.86+ in both the old and new architecture.

Android setup: set minSdkVersion 24, and add the Facededup Maven repository to allprojects.repositories in your root android/build.gradle: https://swiftend-assets-348761024048.s3.eu-west-2.amazonaws.com/m2

iOS: the framework ships inside the package, so pod install is enough. Add NSCameraUsageDescription to Info.plist.

Install
npm install @facededup/liveness-react-native
cd ios && pod install
App.tsx
import { startLiveness } from "@facededup/liveness-react-native";

const r = await startLiveness({
  baseUrl: "https://facededup.ai",
  subjectId: "user_8231",
  licenseCert: "…",        // issued by your account team
  showBranding: false,     // optional: remove the NINAuth mark
});
// r.outcome: "live" | "not_live" | "referred" | "captured" | "cancelled" | "error"
SDKs

Flutter

facededup_liveness 2.0.0-beta.62. The same native capture flow as React Native. Android needs minSdkVersion 24 and the Facededup Maven repository; iOS needs pod install.

pubspec.yaml · main.dart
dependencies:
  facededup_liveness: ^2.0.0-beta.62

final r = await FacededupLiveness.start(LivenessConfig(
  baseUrl: 'https://facededup.ai',
  subjectId: 'user_8231',
  licenseCert: '…',
));
if (r.outcome == 'live') { /* continue */ }
SDKs

Android

ng.facededup:facededup-live 2.0.0-beta.62. Kotlin with Jetpack Compose, CameraX and ML Kit. Minimum SDK 24. Launch it as a ready-made activity, or embed the composable screen in your own UI.

build.gradle.kts
repositories {
  maven { url = uri("https://swiftend-assets-348761024048.s3.eu-west-2.amazonaws.com/m2") }
}
dependencies {
  implementation("ng.facededup:facededup-live:2.0.0-beta.62")
}
Compose
LivenessScreen(
  config = FacededupConfig(baseUrl = "https://facededup.ai", subjectId = "user_8231"),
  onResult = { r -> if (r.isLive) proceed() else retry() },
  onCancel = { finish() },
)
SDKs

iOS

FacededupLive 2.0.0-beta.62. Swift and SwiftUI with AVFoundation and Vision; on Face ID iPhones it uses ARKit and the TrueDepth camera. iOS 14.3+. Set requireDepth: true to fail any capture that shows no real 3D depth on TrueDepth devices. Other iPhones fall back to the standard checks.

SwiftUI
import FacededupLive

FacededupLiveness(config: FacededupConfig(
  baseURL: "https://facededup.ai",
  subjectId: "user_8231",
  requireDepth: true          // optional TrueDepth anti-spoof gate
)) { result in
  // result.outcome: "live" | "not_live" | "referred" | "captured" | "error"
} onCancel: { dismiss() }
Reference

Errors

Errors use standard HTTP status codes and a JSON body with a detail field. detail is usually a string; a few errors return an object with more context, shown below.

StatusUsually meansWhat to do
400A field has an invalid value, or a token couldn't be redeemed: bad signature, expired, or already used.Fix the field named in detail. For tokens, run a fresh check instead of retrying the redeem.
401The key is missing or unknown.Send X-License-Key with a valid key, and check that sandbox and live keys aren't mixed up.
403Consent is missing, refused or withdrawn; the challenge expired, was already used, or the nonce doesn't match; attempts are exhausted; or the risk engine denied the request.Call /v1/challenge again (it lasts 20 s). If detail.error mentions risk, read detail.reasons.
404The request_id, enrollment or place doesn't exist, or the feature isn't enabled for your account.Check the ID came from the same environment (sandbox or live) as your key.
409The face is already enrolled under another account.Read detail.dedup and route the case to review.
422Validation failed: a bad field type, more than 30 frames, no readable face, a NIN or BVN that isn't 11 digits, or poor image quality.For quality, detail.findings says what to fix (light, blur, framing). Let the person retry.
423The request is locked after too many attempts.Start a new check with /v1/request, or refer the person to a human.
503A dependency isn't available or isn't configured for your account.Retry with backoff. If it persists, contact support with the time and request_id.
String detail
403 Forbidden
{ "detail": "challenge expired" }
Object detail · quality
422 Unprocessable Entity
{ "detail": {
  "error": "low_quality",
  "findings": ["too_dark", "face_too_small"],
  "attempts": 2,
  "referred": false
} }
More

Changelog

ReleaseChange
Native 2.0.0-beta.62showBranding option to remove the NINAuth mark. iOS adds requireDepth, a TrueDepth 3D-depth anti-spoof gate.
React Native beta.66Builds on React Native 0.86. The iOS framework ships inside the npm package, so there's no download step. Removed an unused codegenConfig.
Web 0.2.2Face-centred frames and deeper motion proofs, fixing false not_live results on desktop webcams.