Passive Liveness Detection API in cURL: Send a Selfie, Read the JSON
Send a selfie to Didit's standalone Passive Liveness API using cURL and multipart form data. Read the request ID, liveness verdict, score, warnings and capture quality in the JSON response.

Contents
In this guide
Jump to the part you need.
This guide is for developers who hold a selfie and want a liveness verdict from one server-to-server call, no hosted flow, no SDK. One cURL multipart request returns a status, a score, warnings and capture quality. Passive Liveness is published at $0.10 per completed check, read November 26, 2026. The caveat: one image checks for printed photos, screen replays, masks and deepfakes, but the user never has to move.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | Value |
|---|---|
| Endpoint | POST https://verification.didit.me/v3/passive-liveness/ |
| Authentication | x-api-key header, key taken from Developers then API keys in the Business Console |
| Request body | multipart/form-data |
| Required field | user_image, one front-facing face image such as a selfie |
| Accepted formats | tiff, jpg, jpeg, png, webp. PDFs are not accepted |
| Maximum size | 5 MB, then compressed to about 0.5 MB before processing |
| Optional fields | save_api_request (default true) and vendor_data |
| Returns | request_id plus liveness.status, liveness.method, liveness.score, liveness.warnings, liveness.face_quality, liveness.face_luminance, and a liveness.user_image object with liveness.user_image.entities and liveness.user_image.best_angle |
| Price | $0.10 per completed check at list price, the published Passive Liveness price |
| Rate limit | 300 write requests per minute per API key, shared across POST, PATCH and DELETE |
| Sandbox | Free, never billed, returns a static Approved payload after input validation |
Start free in the sandbox at https://business.didit.me/, with no sales call. For developers who want Didit reachable from an AI assistant, the MCP server setup is at https://didit.me/developers/mcp/. The product behind this endpoint is Didit Liveness Detection, and the endpoint reference lists every response field, warning code and severity. For plans, module prices and the cost estimator, see the Didit pricing page.
The minimum working request
Keep the key in the environment variable DIDIT_API_KEY, server side, and this is the whole call:
curl -X POST 'https://verification.didit.me/v3/passive-liveness/' \
-H "x-api-key: $DIDIT_API_KEY" \
-F 'user_image=@./selfie.jpg'
The two optional form fields go on separate lines when you need them:
-F 'save_api_request=false' \
-F 'vendor_data=user-123'
With the defaults, save_api_request is true, so the call is persisted as an API session and the detected face is enrolled in your face search index. Add save_api_request=false for a one-shot check in which Didit creates no API session, stores neither the reference image nor the face crop, and does not enroll the face. Blocklist and duplicate screening run on every live call either way, and prior faces carrying the same vendor_data are excluded from that screening.
Prerequisites before the first call
| What | Detail |
|---|---|
| Plan | The sandbox is free on every plan. On Free, Growth and Scale, live usage draws from available plan credit first and then from top-ups. Enterprise usage beyond invoiced credit is billed as overage. Every live 200 response consumes one Passive Liveness API credit, even when liveness.status is Declined, and an insufficient balance returns 403 before any image processing |
| Client | cURL with multipart form support. The -F flag builds the multipart body and its boundary for you |
| Permissions | An API key that can reach the endpoint. The Primary key of an application has full access. A scoped key needs access to this resource and action, and has to be called from an address inside its IP list when one is set |
| Key format | sk_test_ for a sandbox application, sk_live_ for a live one, then 43 URL-safe characters. Keys created before this format have no prefix and keep working |
| Image | One front-facing face, jpg, jpeg, png, tiff or webp, 5 MB or less |
| Secret handling | The key stays server side. Never ship it to a browser, a mobile bundle or a public repository |
Step by step: send a selfie and read the JSON
Step 1: Get an API key
Log in to the Didit Business Console, choose your Application in the dropdown at the top, open Developers, then API keys. Copy the Primary key, or create a separate key for this service so it only carries the access it needs.
You can also get a key without the console. The register call emails a six-character code, and the verify call returns both applications with their keys inline, as described in API authentication:
curl -X POST https://apx.didit.me/auth/v2/programmatic/register/ \
-H 'Content-Type: application/json' \
-d '{"email": "you@yourdomain.com", "password": "StrongP@ss1"}'
curl -X POST https://apx.didit.me/auth/v2/programmatic/verify-email/ \
-H 'Content-Type: application/json' \
-d '{"email": "you@yourdomain.com", "code": "A3K9F2"}'
Keep sandbox_application.api_key as the environment variable DIDIT_API_KEY while you build, and keep application.api_key aside for live traffic.
Step 2: Prepare one selfie that passes validation
The endpoint takes a single image. The model evaluates the largest detected face and works out a liveness score from 0 to 100. Capture diagnostics come back next to the verdict. Files are compressed to about 0.5 MB before processing, so a very high resolution does not improve accuracy; a well lit, well framed face does.
| Rule | Detail |
|---|---|
| Extensions | tiff, jpg, jpeg, png, webp. A PDF is rejected |
| Size | 5 MB maximum. A larger file is rejected with 400 |
| Compression | Images are compressed to roughly 0.5 MB before the model runs |
| Content | A front-facing face. One subject is the intended input |
| Several faces | MULTIPLE_FACES_DETECTED is a warning severity signal and does not cause a decline on its own. The largest detected face is the one evaluated |

Step 3: Send the multipart request
Point cURL at the file. cURL sets the multipart boundary itself, so do not add a Content-Type header of your own.
curl -X POST 'https://verification.didit.me/v3/passive-liveness/' \
-H "x-api-key: $DIDIT_API_KEY" \
-F 'user_image=@./selfie.jpg' \
-F 'save_api_request=true' \
-F 'vendor_data=user-123'
vendor_data is your own identifier for the person. It changes what the blocklist and duplicate screening return, which step 6 covers in detail.
Step 4: Read the response body
The field names below come from the endpoint schema; the values are illustrative, and this JSON is an excerpt of the response.
{
"request_id": "3f6c1a92-58d4-4b0e-9a17-2c8d5e7b4411",
"liveness": {
"status": "Approved",
"method": "PASSIVE",
"score": 97,
"warnings": [],
"face_quality": 88,
"face_luminance": 74
}
}
The response also carries liveness.user_image.entities and liveness.user_image.best_angle. Read their shape and types from the endpoint reference before you parse them.
Read two results, not one. A live HTTP 200 consumes one Passive Liveness API credit even when liveness.status is Declined. A sandbox HTTP 200 returns a static Approved response without model processing or billing. The liveness.status field tells you the verdict, and a 200 can still carry Declined.
For a live call saved as an API session, the returned request_id is the handle you keep: it works with GET /v3/session/{sessionId}/decision/, and the same persisted session drives the status.updated webhook. Sandbox calls and calls made with persistence disabled create no retrievable session.
Step 5: Branch on status and warnings
liveness.status is Declined when any error severity warning fires. Warnings are signals that each carry a documented code and a severity, so branch on the code rather than on the score alone.
| Status | Warning that fired | What to do |
|---|---|---|
Approved | No error severity warning | Continue. Keep request_id for reference and, when the request was persisted, to fetch the decision later |
Declined | LIVENESS_FACE_ATTACK | Treat this as a suspected presentation attack. Do not approve |
Declined | LOW_LIVENESS_SCORE | The score was at or below face_liveness_score_decline_threshold, which defaults to 30. Ask for a new selfie, or have a person look at the result |
Declined | NO_FACE_DETECTED | Ask the user to retry with a front-facing face in the frame |
Declined | FACE_IN_BLOCKLIST or POSSIBLE_FACE_IN_BLOCKLIST | Apply your blocklist policy. The call does not decide the business outcome for you |
| Does not cause a decline on its own | MULTIPLE_FACES_DETECTED | A warning severity signal. The largest detected face was scored, and you can still ask for a retake with one subject |
| Does not cause a decline on its own | DUPLICATED_FACE or POSSIBLE_DUPLICATED_FACE | Information severity: the face matches, or possibly matches, a face from another approved session. Apply your duplicate policy |

Step 6: Choose save_api_request and vendor_data on purpose
With save_api_request=true, the default, the call is persisted as an API session you can find in the Business Console, the reference image and face crop are stored, and the detected face is enrolled in your face search index so later Face Search calls and duplicate checks can match it. Set it to false for a one-shot check: Didit creates no API session, stores neither the reference image nor the face crop, and does not enroll the face.
Blocklist and duplicate screening run on every live call, with or without save_api_request. Prior faces carrying the same vendor_data are excluded from the whole index search, so re-running liveness for the same user does not raise DUPLICATED_FACE, and a blocklisted face that came from a session with your own vendor_data is not flagged either. Sending a stable value per person therefore keeps that person's earlier faces out of both the duplicate and the blocklist results.
Step 7: Test in the sandbox, then switch to the live key
Sandbox API keys skip all processing and billing. After request validation, which still returns 400 on malformed input, the endpoint answers with a static Approved mock payload, persists no session and consumes no credits. The sandbox tests multipart validation, HTTP error handling and parsing of that static Approved response. It cannot produce a model-driven Declined result or a warning branch, so exercise those with fixtures built from the documented warning codes and severities. Swap DIDIT_API_KEY for the live key once the organization has credit.
Field and event mapping
| Field or event | Type | What it means | Where it lands |
|---|---|---|---|
request_id | UUID | Identifier of the persisted API session when save_api_request is true | Your records, the decision endpoint, the status webhook |
liveness.method | PASSIVE | Which liveness method produced the verdict | Log it next to the score for audit |
liveness.status | Enum | The verdict, from the shared status enum | Your approve, reject or retake branch |
liveness.score | 0 to 100 | Liveness score for the evaluated face | Thresholds and your own review rules |
liveness.warnings | Signals, each with a documented code and a severity | Risk signals such as LIVENESS_FACE_ATTACK or MULTIPLE_FACES_DETECTED | Your branching table from step 5 |
liveness.face_quality | 0 to 100, nullable | Capture diagnostic for the submitted image | Decide whether to ask for a retake before a resubmission |
liveness.face_luminance | 0 to 100, nullable | Capture diagnostic for the lighting of the image | Same retake decision, plus capture guidance in your UI |
liveness.user_image.entities | Documented in the endpoint reference | Part of the user_image object in the response | Read its shape from the reference before mapping it |
liveness.user_image.best_angle | Documented in the endpoint reference | Part of the user_image object in the response | Read its shape from the reference before mapping it |
status.updated webhook | Event | Session status change for a persisted API request | Subscribe instead of polling |
GET /v3/session/{sessionId}/decision/ | Endpoint | The decision for the persisted session behind request_id | Fetch later, or from a back office tool |
Check the JSON representation of warnings against a real response before you write a parser, because the endpoint reference documents the codes and severities rather than one fixed body shape for every entry.
Install routes: MCP connector and API recipe
There are two documented ways to put Didit in front of your team or your service, and they differ in who makes the call.
- MCP connector. The Didit MCP server is hosted at
https://mcp.didit.me/mcpand signs in with OAuth. It is included free with every plan, and the MCP setup instructions are at https://didit.me/developers/mcp/. The supplied docs do not identify an MCP tool for this selfie upload, so the documented route for this endpoint is the multipart API call in step 3. - API recipe. Your own service holds the key and sends the cURL call from step 3. Hand the whole integration to a coding agent with the integration prompt, which covers sessions, standalone APIs, webhooks and error handling in one file.
Use the standalone API when your service already has a captured selfie and needs to handle the liveness result itself. Reach for the MCP server when you want Didit checks reachable from an AI assistant conversation.

Test in the sandbox: expected success, error cases and fixes
A valid multipart request with a sandbox key returns 200 and the static Approved payload. Didit persists no API session and consumes no credits, so a green run proves your request shape and your response parsing, not the accuracy of the model on a real image.
| Symptom | Status | Body | Fix |
|---|---|---|---|
| Field missing or named wrong | 400 | Validation error | Send -F 'user_image=@./selfie.jpg' exactly |
| File larger than 5 MB | 400 | Upload rejected | Resize or re-export below 5 MB |
| PDF or an unsupported extension | 400 | Unsupported extension | Convert to jpg, jpeg, png, tiff or webp |
| Image validation error, such as a corrupt or unreadable image | 400 | Read the returned body. This endpoint reference does not document a fixed body for this case | Inspect the returned body, re-export the image and try again |
| No balance | 403 | {"error": "You don't have enough credits ..."} | Top up at business.didit.me, then retry |
| Key missing, invalid, revoked or expired | 403 | {"detail": "You do not have permission to perform this action."} | Check that x-api-key carries your application's key. This endpoint never returns 401 |
| Key without access to this resource or action, or a call from outside the key's IP list | 403 | A detail that names the reason | Inspect the returned detail, then use a key with that access, from an allowed address |
| Too many writes | 429 | JSON detail | Read the Retry-After response header, wait at least that long, then retry with backoff and jitter |
| Unexpected server failure | 500 | May have no JSON body | Retry with backoff, and parse the body defensively |
Every refusal, fix and retry rule is listed on the API errors page, and the 429 headers and backoff guidance are on rate limiting.
To disconnect, delete the key you created in Developers then API keys, or delete the application if the whole workspace is going away. A deleted application answers with application_deleted for a few minutes and is then refused like any invalid key, so do not retry.
Detecting deepfakes from a single selfie
The passive model looks for artifacts and texture patterns that separate a real face from a spoof, across printed photos, screen replays, masks and deepfakes, and it reports a presentation attack as LIVENESS_FACE_ATTACK rather than in prose. Inference is documented as sub-two-second. 4,000+ companies use Didit.
Passive liveness fits a selfie you already captured: one frame, no user action, decided server side. When the user can go through a hosted flow instead, a workflow can run an interactive method such as 3D actions or flashing, priced at $0.15 per check against $0.10 for the passive liveness step inside a session. The product is Didit Liveness Detection, where the method comparison sits, and every risk code is catalogued in the liveness warnings reference.
Cost of both ends
On the Didit side the published unit price for this check is $0.10 per completed check, the Passive Liveness line of the live price feed, read November 26, 2026, and the full ID check that contains it is $0.33. Billing follows the response, so a live HTTP 200 consumes one Passive Liveness API credit and a 400 or a 403 does not. A 403 for an insufficient balance comes back before any image processing. The MCP server is included with every plan and adds nothing to the bill, whether you call the endpoint from your own service or reach Didit from an assistant.
Worked example at 25,000 completed live responses in a month, at the published rate:
- Usage at list price: 25,000 x $0.10 = $2,500.00.
- Growth: 4% off every price, so $0.096 x 25,000 = $2,400.00 of usage. The plan fee is $99 a month and includes $115.00 of credit, so that credit covers $115.00 and $2,285.00 remains payable from top-ups. Month total: $99.00 + $2,285.00 = $2,384.00.
- Scale: 10% off every price, so $0.09 x 25,000 = $2,250.00 of usage. The plan fee is $299 a month and includes $350.00 of credit, so $350.00 is covered by credit and $1,900.00 remains payable from top-ups. Month total: $299.00 + $1,900.00 = $2,199.00.
- Free: the $10.00 monthly credit buys 100 calls at $0.10 each ($10.00 / $0.10 = 100). The $10 monthly Free credit is available to the first organization created with an eligible work email for a company domain. An organization created through the API starts at $0. Top-ups beyond the credit start at $50.
- For contrast, the same 25,000 people through a full ID check at $0.33 is 25,000 x $0.33 = $8,250.00. That bundle is ID document $0.15, passive liveness $0.10, Face Match 1:1 at $0.05 which is the workflow step rate, and device and IP analysis $0.03.
Plan fees, credits and every module price are on https://didit.me/pricing/, and the billing rules are in the pricing docs.
Sources
- Didit docs: Passive Liveness API reference
- Didit Liveness Detection: product overview and method comparison
- Didit docs: liveness warning catalogue
- Didit docs: API authentication
- Didit docs: API errors, status codes and fixes
- Didit docs: rate limiting and 429 backoff
- Didit docs: pricing and billing rules
- Didit public price book, read November 26, 2026
- Didit pricing page and live price feed, read November 26, 2026
- Didit MCP server and the integration prompt
Our suggested next step: open https://business.didit.me/, create an application, and run the cURL request above with a sandbox key and a test selfie. No sales call, and the sandbox stays free while you build.
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
How do I call the Didit passive liveness API with cURL?
Send a POST to https://verification.didit.me/v3/passive-liveness/ with your key in the x-api-key header and the selfie as a multipart field named user_image. The minimum command is cURL with -F 'user_image=@./selfie.jpg'. Add -F 'save_api_request=false' if you do not want the image stored or the face enrolled.
What does the passive liveness API cost?
Passive Liveness is published at $0.10 per completed check at list price, and a full ID check that includes it is $0.33. Growth takes 4% off every Didit price and Scale takes 10% off. Billing is per completed check from prepaid credit, so a request rejected before processing is not billed.
Which image formats and file sizes does the endpoint accept?
It accepts tiff, jpg, jpeg, png and webp, up to 5 MB, and rejects PDFs. Larger files fail with 400. The image is compressed to about 0.5 MB before the model runs, so a very high resolution does not improve accuracy.
What happens if the selfie contains more than one face?
The call still returns a verdict. MULTIPLE_FACES_DETECTED is a warning severity signal that does not cause a decline on its own, and the largest detected face is the one that gets scored. You can still ask the user for a retake with a single subject.
Can this API detect a deepfake from a single selfie?
Yes. The model looks for presentation attacks such as printed photos, screen replays, masks and deepfakes, and reports them as LIVENESS_FACE_ATTACK with a Declined status. Inference is documented as sub-two-second.
Does a wrong API key return 401 or 403?
This endpoint returns 403, never 401. A missing or invalid key answers 403 with the detail You do not have permission to perform this action. A key that has no access to this resource or action, or a call from outside the key's IP list, also returns 403 and the returned detail names the reason, so inspect it. An insufficient credit balance is a 403 as well, with an error body that says the balance cannot cover the call.
What does save_api_request do and when should I set it to false?
With the default value true, the call is persisted as an API session, the reference image and face crop are stored, and the face is enrolled in your face search index for later Face Search and duplicate checks. Set it to false for a one-shot check where Didit creates no API session, stores neither the reference image nor the face crop, and does not enroll the face. Blocklist and duplicate screening run on live calls with either setting. Sandbox calls skip screening.
Does setting save_api_request to false disable blocklist and duplicate screening?
No. Screening runs on every live call, with or without save_api_request, by matching the detected face against your application's face search index. A one-shot live call can still return blocklist or duplicate signals. It creates no API session, stores neither the reference image nor the face crop, and does not enroll the face.
How does vendor_data affect blocklist and duplicate results?
Prior faces carrying the same vendor_data are excluded from the whole index search. A repeat liveness check for the same person therefore does not raise DUPLICATED_FACE, and a blocklisted face that came from a session with your own vendor_data is not flagged either. Send a stable value per person and those self-matches stay out of the result.
Why does every valid sandbox request return Approved?
Sandbox keys skip all processing and billing, so after request validation the endpoint returns a static Approved mock payload. That is expected behaviour, not a model result. Malformed input still returns 400, so the sandbox is the right place to test request shape, error handling and parsing, and you test the decline and warning branches with your own fixtures.
Can I call this endpoint from a browser or a mobile app?
Call the Didit Passive Liveness API from your backend. Keep the x-api-key value out of browser and mobile bundles, and pass only the verdict to the client. If you need the capture screen on the device, run the hosted session flow or a Didit SDK instead.
Do I need a workflow or a session to use the standalone liveness API?
No. This is a server-to-server call that takes one image and answers immediately, with no workflow, no hosted screen and no SDK. Setting save_api_request=true does create an API type session you can inspect and query, but you never configure a workflow to use it.
How is passive liveness different from Face Match?
Passive liveness answers whether a live person is in the image, not who they are. Face Match 1:1 compares two faces, for example the selfie against the photo on an ID document, and is priced at $0.05 per check as a workflow step. A full Didit ID check runs both, plus document and device and IP analysis, for $0.33.
What do face_quality and face_luminance tell me?
Both are 0 to 100 values and both are nullable. They are capture diagnostics: how usable the submitted image is and how its lighting reads. Use them to decide whether to ask for a retake before a resubmission, not as an explanation of the liveness score.
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


