Skip to main content

Document Liveness

Run Document Liveness

POST /verifications/{id}/documents/{doc_id}/liveness

Checks whether a document is authentic (not a photocopy or printout).

Request:

curl -X POST https://api.dev.valydar.com/verifications/{id}/documents/{doc_id}/liveness \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"passed": true,
"score": 0.93,
"checks": [
{
"name": "background",
"passed": true,
"score": 0.95,
"reason": "uniform background detected"
},
{
"name": "lighting_gradient",
"passed": true,
"score": 0.91,
"reason": "natural lighting gradient"
},
{
"name": "edge_softness",
"passed": true,
"score": 0.89,
"reason": "edges are soft, not printed"
},
{
"name": "moire_pattern",
"passed": true,
"score": 0.96,
"reason": "no moiré pattern detected"
},
{
"name": "colour_quantisation",
"passed": true,
"score": 0.92,
"reason": "natural colour distribution"
},
{
"name": "perspective_hint",
"passed": true,
"score": 0.94,
"reason": "correct perspective geometry"
}
]
}
FieldTypeDescription
passedbooleanWhether document appears authentic
scorefloatOverall confidence (0.0 to 1.0)
checksarrayIndividual check results

Check Names:

CheckDescription
backgroundBackground uniformity analysis
lighting_gradientNatural lighting gradient detection
edge_softnessEdge softness (printed edges are sharp)
moire_patternMoiré pattern detection (screens/printers)
colour_quantisationColour quantisation analysis
perspective_hintGeometric perspective validation