Skip to main content

Technical

Selfie Verification and Deepfake Detection: How It Works

Selfie verification pairs liveness (is a real person in front of the camera) with 1:1 face match (is it the right person). In a Didit session that costs $0.10 for passive liveness plus $0.05 for face match.

Selfie Verification and Deepfake Detection: How It Works

Contents

In this guide

Jump to the part you need.

Selfie verification answers two questions from one capture: is a live person in front of the camera, and is that person the one on the enrolled portrait. It fits onboarding, account recovery and re-authentication. Passive liveness costs $0.10 and face match $0.05 inside a session. The caveat: no image model alone stops an injected camera feed, so pair it with device and IP signals.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Selfie verification at a glance: what each check answers, the module and the list price
CheckQuestion it answersDidit moduleList priceDefault decision rule
LivenessIs a real person in front of the camera, not a printed photo, a screen replay, a mask or a deepfake?Liveness (passive, 3D action, flashing)$0.10 passive, $0.15 activeDeclined at or below the liveness score threshold, default 30, or on LIVENESS_FACE_ATTACK
Face match 1:1Is this selfie the same person as the document portrait or the enrolled photo?Face Match$0.05Approved when the score is strictly above the threshold, default 30
Face search 1:NHas this face been seen before, or is it on a blocklist?Face Search$0.05 per searchDeclined only on a blocklist hit, duplicates are informational
Device and IPSame device or network as a known fraud case?Device and IP Analysis$0.03Your rules decide decline or review
Full pictureAll of the above plus the ID documentFull KYC$0.33Combined into one decision

Start free in the sandbox at business.didit.me (no sales call) and run the steps below against test keys. Developers who want an AI assistant to wire the flow can connect Didit through the Didit MCP server, or hand the whole job to a coding agent with the integration prompt. Prices here come from the live price feed, and the pricing page carries the full list and the cost estimator.

The verification steps in a Didit flow, from document capture to the selfie and the combined decision
A selfie check is one step inside a Didit flow, alongside document capture, and both contribute to one decision payload.

What a selfie check has to prove

Three separate facts, and each needs a different signal:

  • A live body was in front of the lens at capture time. That is liveness. Our liveness documentation describes one model for presentation attacks (prints, screens, masks) and a score from 0 to 100 per face.
  • The face belongs to the person we already know. That is 1:1 face match against a reference portrait, described in the face match documentation.
  • The capture reached us from a real device session, not from an emulator, a virtual camera or a replayed stream. Image models infer this from artifacts; device and IP analysis adds the session context, described in the device and IP documentation.

Get the order wrong and you pay twice. Consider the risk scenario: a spoofed selfie generated from the victim's own photos can return a high similarity score, so a similarity score is evidence about identity, never evidence about liveness. Run liveness before approving the selfie, then use face match when your workflow requires comparison with a reference portrait.

Which liveness method to pick

Our docs list three methods, and the workflow setting face_liveness_method accepts PASSIVE, ACTIVE_3D or FLASHING.

Liveness methods and where each one fits
MethodHow it worksSecurity levelBest for
3D action and flash (ACTIVE_3D)A randomized action such as blinking or nodding, combined with projected light patterns that build a depth map from the reflectionsHighestBanking, healthcare, government
3D flash (FLASHING)Light patterns projected above 30 frames per second, depth map built without asking the user to moveHighFinancial services, account access
Passive (PASSIVE)Single-frame deep learning over texture, artifacts and facial structureStandardLower-risk onboarding and re-authentication

The liveness documentation states 99.9% accuracy with a false acceptance rate under 0.1%. Our certification list includes iBeta Level 1 PAD, and inference runs in the sub-2-second range at p99. Pick the method that matches the value at risk, and write the policy down before the first user arrives: if a selfie passes but LIVENESS_FACE_ATTACK or DEVICE_LINKED_TO_LIVENESS_ATTACK fires, your team needs a documented answer on decline versus manual review.

Prerequisites

  • A Didit organization and a sandbox API key. Sandbox calls are free and return a static Approved mock payload, so they validate your request shape, never your thresholds.
  • A workflow containing LIVENESS. Add ID_VERIFICATION and FACE_MATCH when the selfie must be compared to a document portrait.
  • Images as jpg, jpeg, png, tiff or webp, maximum 5 MB each. PDFs are rejected. Files are compressed to roughly 0.5 MB before processing, so higher resolution does not improve accuracy.
  • One clear, front-facing face per image. Several faces in frame raise MULTIPLE_FACES_DETECTED.
  • A reference portrait for any 1:1 match: the ID document photo, or a photo you enrolled earlier.

Step by step: the session flow

  1. In the Business Console, create a workflow with LIVENESS. Add FACE_MATCH together with ID_VERIFICATION when the comparison target is the document portrait. Set face_liveness_method to PASSIVE, ACTIVE_3D or FLASHING.
  2. Set your thresholds before you send traffic. face_liveness_score_decline_threshold defaults to 30. face_match_score_decline_threshold defaults to 30. face_match_max_attempts defaults to 3 and accepts 1 to 3. Raise the face match threshold for high-value flows, and expect more retries when you do.
  3. Create the session with your workflow id, your own user reference and a callback URL.
curl -X POST 'https://verification.didit.me/v3/session/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"workflow_id": "YOUR_WORKFLOW_ID",
"vendor_data": "user-123",
"callback": "https://yourapp.com/post-kyc"
}'
  1. Send the user to the returned session.url, or mount the Web or Mobile SDK. The camera capture, the framing guidance and any retry coaching happen inside that hosted flow.
  2. Fetch the decision with GET /v3/session/{sessionId}/decision/, or subscribe to the session.status.updated webhook. Liveness results land in the liveness_checks[] array, one entry per liveness node. Face match results land in face_matches[].
  3. Branch on status and warnings. Approved continues, Declined stops, In Review goes to a human queue. The warning sections below list the codes worth acting on.
  4. If you already hold both images and want a single server-to-server call, skip the session and use the standalone endpoints in the next section.
  5. Keep your own record of the vendor_data and the session id. Use the returned request_id to retrieve the saved session decision when the request was persisted.
The selfie and liveness step inside a Didit workflow, between document capture and the final decision
Where the selfie step sits in the flow: after document capture, before the combined decision.

Step by step: the standalone calls

Use these when a selfie already exists. Each call is one request and one response with no retry budget, so your own interface has to offer the retry. Persistence is a separate switch: set save_api_request=true and the call is saved as an API-type session you can look up later; set it to false and nothing is stored.

curl -X POST 'https://verification.didit.me/v3/passive-liveness/' \
-H 'x-api-key: YOUR_API_KEY' \
-F user_image=@./selfie.jpg \
-F save_api_request=true \
-F vendor_data=user-123
curl -X POST 'https://verification.didit.me/v3/face-match/' \
-H 'x-api-key: YOUR_API_KEY' \
-F user_image=@./selfie.jpg \
-F ref_image=@./id_portrait.jpg \
-F save_api_request=true \
-F vendor_data=user-123

Three details decide your data retention policy and your retry behaviour. The standalone endpoint is single-shot with no retry budget. When save_api_request=true, it persists as an API session: on the passive liveness call the reference image is stored, the face is enrolled into your face search index and a status.updated webhook fires; when false, it is not persisted, nothing is enrolled, and blocklist and duplicate screening still run. The face match endpoint never enrolls faces and never runs blocklist screening, so route duplicate and blocklist checks through passive liveness or POST /v3/face-search/. Retries and coaching messages exist only in the hosted session flow, never on these two endpoints.

Expected output

The passive liveness response carries these fields. Values are omitted here because they depend on the image.

{
  "request_id": "...",
  "liveness": {
    "status": "Approved | Declined | In Review",
    "method": "PASSIVE",
    "score": 0,
    "user_image": { "entities": [], "best_angle": null },
    "warnings": [],
    "face_quality": 0,
    "face_luminance": 0
  }
}

The face match response carries the similarity score and both entity blocks.

{
  "request_id": "...",
  "face_match": {
    "status": "Approved | Declined",
    "score": 0,
    "user_image": { "entities": [] },
    "ref_image": { "entities": [] },
    "warnings": []
  }
}

score runs 0 to 100 and status is Approved when the score is strictly above the decline threshold, otherwise Declined with a LOW_FACE_MATCH_SIMILARITY warning. If no face pair can be scored at all, the call still returns 200 with status: "Declined" and a NO_REFERENCE_IMAGE warning. Those are capture problems, not fraud, and should reach the user as a retry.

Warning codes and what each one means for your policy

Liveness and face match warnings, severity and the action they justify
WarningSeverityWhat to do
LIVENESS_FACE_ATTACKErrorA presentation attack is suspected. Do not approve, whatever the face match score says.
LOW_LIVENESS_SCOREErrorScore at or below the threshold, default 30. Decline, and check your lighting guidance first.
NO_FACE_DETECTEDErrorCapture problem. Ask for a retry with a single, well-framed face.
MULTIPLE_FACES_DETECTEDWarningDoes not decline on its own. Ask for a retry with one face in frame.
FACE_IN_BLOCKLISTErrorDefinitive blocklist hit. Reject.
POSSIBLE_FACE_IN_BLOCKLISTBorderlineRoute to manual review, do not auto-reject.
DUPLICATED_FACE, POSSIBLE_DUPLICATED_FACEInformationNever declines. Apply your own duplicate-account policy.
LOW_FACE_MATCH_SIMILARITYErrorRetry within the attempt budget, then decline.
NO_REFERENCE_IMAGEDeclinedNo usable reference portrait. Fix the reference, then retry.
DEVICE_LINKED_TO_LIVENESS_ATTACKDevice signalThis device produced a previous liveness attack. Treat as high risk even if this selfie passes.

Two of those deserve a note. Blocklist and duplicate screening run on every passive liveness call, with or without save_api_request, against your application's face search index. And prior faces sharing the same vendor_data are excluded from the index search, so a legitimate user who re-runs liveness is not flagged as their own duplicate.

Deepfake and injection attacks: where the image model stops

Be precise about the boundary, because buyers ask and vendors exaggerate.

  • Presentation attacks are in scope. A printed photo held to the lens, a phone screen replaying a video, a mask, or a synthetic face rendered on a display all leave traces the passive model scores. The 3D methods go further, because a light pattern projected onto a flat screen produces a depth map that does not look like a face.
  • Face swaps and generated faces are in scope for the same reason: the artifact pattern of a re-rendered face differs from a live capture, and the score reflects that.
  • Injection is a different problem. If a virtual camera feeds a pre-recorded or generated stream directly into the capture pipeline, the pixels can look genuine. The countermeasures are session context: duplicated device fingerprints, a device previously linked to a liveness attack, VPN, proxy or Tor exits, and location that disagrees with the document. Our device and IP documentation lists all of these as risk codes on the decision payload.

That is why we recommend running liveness inside a hosted session rather than posting selfies from an arbitrary client. A single image can be perfect and still arrive from the wrong place.

Failure cases and recovery

  • HTTP 403 means no credits left, or a missing or invalid API key. These endpoints return 403 rather than 401, and no image is processed, so nothing is charged.
  • HTTP 400 means a missing user_image or ref_image, a file above 5 MB, an unsupported extension, or a PDF. Validate on the client before upload.
  • HTTP 429 means you exceeded the shared write budget of 300 requests per minute per API key across all POST, PATCH and DELETE endpoints. Queue on your side.
  • A retryable face match failure keeps the user on the step. While attempts remain, the session returns feedback_codes with the attempt count, and the Web and Mobile SDKs surface them as coaching messages such as improving lighting. Once face_match_max_attempts is exhausted, the computed status applies.
  • Retries apply to the session flow only. The standalone endpoint is single-shot with no retry budget. When save_api_request=true, it persists as an API session; when false, it is not persisted. Build your own retry loop with a hard cap.

Inputs and outputs

What you send and what you get back, per call
Field or callDirectionNotes
user_imageInputThe live selfie. Required on both standalone endpoints. Max 5 MB.
ref_imageInputThe reference portrait. Required on face match only.
vendor_dataInputYour own user reference. Also scopes duplicate exclusion.
save_api_requestInputDefaults to true. Controls persistence and face enrolment. It never adds a retry.
face_match_score_decline_thresholdInputDefault 30, range 0 to 100.
request_idOutputSession id you can pass to the decision endpoint when the request was saved.
liveness.score, liveness.statusOutputThe liveness verdict for the largest detected face.
face_match.score, face_match.statusOutputSimilarity 0 to 100 and the resulting verdict.
warnings[]OutputRisk codes from the liveness or face match catalogue.
face_quality, face_luminanceOutputCapture quality, 0 to 100, nullable. Useful for tuning your capture UI.

Billing is per completed check, from prepaid credit. On the live feed: passive liveness $0.10 in a session, the standalone Passive Liveness API line $0.05 per call, active liveness $0.15, face match $0.05 either in a session or through the API, face search $0.05 per search, device and IP analysis $0.03, ID document only $0.15, and the full KYC bundle $0.33.

Each 200 response consumes one credit. If the balance cannot cover a call, the endpoint returns 403 before any image processing. Sandbox keys skip processing and billing entirely and return a static Approved payload, so a green sandbox run tells you nothing about how your thresholds behave in production. The workflow orchestrator, the MCP server, the SDKs and reusable KYC carry no charge.

The review boundary is a policy decision, not a model output. These land in human hands: borderline blocklist matches, duplicate faces when your policy says merge or investigate, and front-camera duplicate matches where the name or date of birth disagrees with the previously approved user. Anything a model flags as In Review stops there until someone clears it with a written reason.

Worked cost example

Take 20,000 selfie checks a month against an enrolled portrait, with no document step: passive liveness $0.10 + face match $0.05 + device and IP $0.03 = $0.18 per check. 20,000 multiplied by $0.18 is $3,600 a month.

On the Scale plan every Didit price is 10% lower: $0.09 + $0.045 + $0.027 = $0.162 per check, so 20,000 multiplied by $0.162 is $3,240 a month.

Add a separate face search pass on 4,000 of those checks at $0.05: 4,000 multiplied by $0.05 is $200. If the flow also collects an ID document, the full KYC bundle already includes liveness, face match and device and IP at $0.33, so 20,000 multiplied by $0.33 is $6,600 a month, and the $0.18 line disappears.

For scale, the Free plan's $10 of monthly credit covers about 55 selfie checks at $0.18 each (10 divided by 0.18).

Sources

Next step: create a sandbox organization at business.didit.me, build a workflow with liveness and face match, and run one test selfie through the flow. No sales call, and the sandbox is free on every plan.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

What is selfie verification?

Selfie verification is a check that combines liveness detection, which confirms a real person is in front of the camera rather than a photo, a replay, a mask or a deepfake, with 1:1 face match, which compares that selfie to a reference portrait such as an ID document photo. Didit prices passive liveness at $0.10 per check in a session and face match at $0.05 per check.

How does Didit detect a deepfake selfie?

The passive liveness model scores a single face image from 0 to 100 and the check is Declined when the score falls at or below face_liveness_score_decline_threshold (default 30) or when the model raises LIVENESS_FACE_ATTACK. For higher-risk flows, 3D action and flashing liveness add a randomized user action plus projected light patterns that build a depth map, which can be harder for flat screens or printed photos to reproduce. The liveness documentation states 99.9% accuracy with a false acceptance rate under 0.1%.

What is the difference between passive and active liveness?

Passive liveness analyzes one frame with deep learning and asks nothing of the user. 3D flash projects light patterns above 30 frames per second and reads the reflections to build a depth map without user movement. 3D action adds a randomized action such as blinking or nodding on top of the light pattern analysis and carries the highest security level, which is why our docs recommend it for banking, healthcare and government flows.

What face match score counts as a pass?

A score strictly above face_match_score_decline_threshold returns Approved; the default threshold is 30, and a score at or below it returns Declined with a LOW_FACE_MATCH_SIMILARITY warning. The threshold is yours to set, so a high-value account can require a higher score than low-risk onboarding. Raising it increases security and retries at the same time.

How much does selfie verification cost?

Inside a Didit session, passive liveness is $0.10 per check and face match is $0.05 per check, so a selfie check against an enrolled portrait is $0.15 before optional signals. Adding device and IP analysis at $0.03 brings it to $0.18. A full KYC check that also reads an ID document is $0.33, which already includes liveness, face match and device and IP.

Can a user retry a failed face match?

Yes, in the session flow. face_match_max_attempts defaults to 3 and accepts 1 to 3 submissions per session, and while attempts remain a retryable failure returns feedback_codes that the Web and Mobile SDKs turn into coaching messages. Once the budget is exhausted, the computed status, Declined or In Review, applies. The standalone POST /v3/face-match/ endpoint is single-shot with no retry budget, and it persists as an API session when save_api_request=true and is not persisted when it is false.

What does FACE_IN_BLOCKLIST mean?

It means the detected face matched an entry on your application's face blocklist, and it is an error-severity warning that declines the check, so you should reject. A related code, POSSIBLE_FACE_IN_BLOCKLIST, is a borderline match below the hard threshold and should go to manual review rather than an automatic rejection. Blocklist screening runs on every passive liveness call, with or without save_api_request.

Can I run a liveness check on a selfie I already captured?

Yes. POST /v3/passive-liveness/ accepts one user_image in jpg, jpeg, png, tiff or webp up to 5 MB and returns a liveness status, a score, warnings and capture quality fields. Set save_api_request=true if you want the call persisted as a session with the face enrolled for later search, or false for a one-shot check that stores nothing.

Does the sandbox return real liveness or face match scores?

No. Sandbox API keys skip all processing and billing, and after request validation the endpoint returns a static Approved mock payload with no session persisted and no credits consumed. Use the sandbox to confirm your request shape, field names and error handling, then test thresholds with live keys on a staging workflow.

Does face match enrol faces or run blocklist checks?

No. The face match endpoint never enrolls faces into your face search index and never runs blocklist or duplicate screening. Use POST /v3/passive-liveness/ with save_api_request=true or POST /v3/face-search/ when you need duplicate detection or blocklist matching.

Do I need the ID document step to use face match?

No. Face match compares any two faces, so the reference can be the ID document portrait or a photo you enrolled earlier. Many teams use liveness plus face match against an enrolled photo for login and account recovery, which is priced as a selfie login check at $0.10 plus the face match at $0.05, and only run the document step at first onboarding.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.