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.

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.
| Check | Question it answers | Didit module | List price | Default decision rule |
|---|---|---|---|---|
| Liveness | Is 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 active | Declined at or below the liveness score threshold, default 30, or on LIVENESS_FACE_ATTACK |
| Face match 1:1 | Is this selfie the same person as the document portrait or the enrolled photo? | Face Match | $0.05 | Approved when the score is strictly above the threshold, default 30 |
| Face search 1:N | Has this face been seen before, or is it on a blocklist? | Face Search | $0.05 per search | Declined only on a blocklist hit, duplicates are informational |
| Device and IP | Same device or network as a known fraud case? | Device and IP Analysis | $0.03 | Your rules decide decline or review |
| Full picture | All of the above plus the ID document | Full KYC | $0.33 | Combined 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.

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.
| Method | How it works | Security level | Best 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 reflections | Highest | Banking, healthcare, government |
3D flash (FLASHING) | Light patterns projected above 30 frames per second, depth map built without asking the user to move | High | Financial services, account access |
Passive (PASSIVE) | Single-frame deep learning over texture, artifacts and facial structure | Standard | Lower-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
Approvedmock payload, so they validate your request shape, never your thresholds. - A workflow containing
LIVENESS. AddID_VERIFICATIONandFACE_MATCHwhen the selfie must be compared to a document portrait. - Images as
jpg,jpeg,png,tifforwebp, 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
- In the Business Console, create a workflow with
LIVENESS. AddFACE_MATCHtogether withID_VERIFICATIONwhen the comparison target is the document portrait. Setface_liveness_methodtoPASSIVE,ACTIVE_3DorFLASHING. - Set your thresholds before you send traffic.
face_liveness_score_decline_thresholddefaults to 30.face_match_score_decline_thresholddefaults to 30.face_match_max_attemptsdefaults to 3 and accepts 1 to 3. Raise the face match threshold for high-value flows, and expect more retries when you do. - 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"
}'
- 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. - Fetch the decision with
GET /v3/session/{sessionId}/decision/, or subscribe to thesession.status.updatedwebhook. Liveness results land in theliveness_checks[]array, one entry per liveness node. Face match results land inface_matches[]. - Branch on status and warnings.
Approvedcontinues,Declinedstops,In Reviewgoes to a human queue. The warning sections below list the codes worth acting on. - 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.
- Keep your own record of the
vendor_dataand the session id. Use the returnedrequest_idto retrieve the saved session decision when the request was persisted.

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
| Warning | Severity | What to do |
|---|---|---|
LIVENESS_FACE_ATTACK | Error | A presentation attack is suspected. Do not approve, whatever the face match score says. |
LOW_LIVENESS_SCORE | Error | Score at or below the threshold, default 30. Decline, and check your lighting guidance first. |
NO_FACE_DETECTED | Error | Capture problem. Ask for a retry with a single, well-framed face. |
MULTIPLE_FACES_DETECTED | Warning | Does not decline on its own. Ask for a retry with one face in frame. |
FACE_IN_BLOCKLIST | Error | Definitive blocklist hit. Reject. |
POSSIBLE_FACE_IN_BLOCKLIST | Borderline | Route to manual review, do not auto-reject. |
DUPLICATED_FACE, POSSIBLE_DUPLICATED_FACE | Information | Never declines. Apply your own duplicate-account policy. |
LOW_FACE_MATCH_SIMILARITY | Error | Retry within the attempt budget, then decline. |
NO_REFERENCE_IMAGE | Declined | No usable reference portrait. Fix the reference, then retry. |
DEVICE_LINKED_TO_LIVENESS_ATTACK | Device signal | This 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_imageorref_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_codeswith the attempt count, and the Web and Mobile SDKs surface them as coaching messages such as improving lighting. Onceface_match_max_attemptsis 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; whenfalse, it is not persisted. Build your own retry loop with a hard cap.
Inputs and outputs
| Field or call | Direction | Notes |
|---|---|---|
user_image | Input | The live selfie. Required on both standalone endpoints. Max 5 MB. |
ref_image | Input | The reference portrait. Required on face match only. |
vendor_data | Input | Your own user reference. Also scopes duplicate exclusion. |
save_api_request | Input | Defaults to true. Controls persistence and face enrolment. It never adds a retry. |
face_match_score_decline_threshold | Input | Default 30, range 0 to 100. |
request_id | Output | Session id you can pass to the decision endpoint when the request was saved. |
liveness.score, liveness.status | Output | The liveness verdict for the largest detected face. |
face_match.score, face_match.status | Output | Similarity 0 to 100 and the resulting verdict. |
warnings[] | Output | Risk codes from the liveness or face match catalogue. |
face_quality, face_luminance | Output | Capture quality, 0 to 100, nullable. Useful for tuning your capture UI. |
Paid steps and review boundaries
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
- Didit docs: Liveness Detection API, methods, score thresholds and warnings
- Didit docs: Passive Liveness API reference
- Didit docs: Face Match 1:1 overview, retries and feedback codes
- Didit docs: Face Match API reference
- Didit docs: Face Search 1:N and blocklist integration
- Didit docs: Device and IP Analysis, duplicate device and risk codes
- Didit docs: pricing and billing rules
- Didit pricing page and cost estimator
- Didit pricing as JSON, read November 26, 2026
- Didit MCP server setup for AI assistants
- Didit integration prompt for coding agents
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.
The product this post is about, taken from its topic. Run it free in the sandbox.
Author
Alberto Rosas
Co-founder and CEO

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.
Your obligations · 3 regions
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.
- 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.
Didit Academy


