1. Start a Session
Initialize a secure verification session. This returns a set of random liveness challenges and a cryptographic token.
POST
/api/session/start
| Header | Type | Description |
|---|---|---|
x-api-key |
String | Your unique client API key for authentication. |
2. Complete Verification
Submit the computed 128-D facial descriptor and liveness score. The API will perform deduplication and save the verified identity to the database.
POST
/api/session/complete
| Body Parameter | Type | Description |
|---|---|---|
sessionId | String | The ID returned from start endpoint. |
token | String | The secure token from start endpoint. |
analysis.descriptor | Array | 128D Float32Array from face-api. |
analysis.referencePhoto | String | Base64 encoded JPEG. |
Start Session Examples
cURL
Node.js
Python
curl -X POST https://api.secretcircle.com/v1/session/start \
-H "x-api-key: sk_live_123456789"
# Expected Response:
# {
# "sessionId": "req_8f92bd",
# "token": "tok_991823",
# "challenges": ["lookLeft", "lookRight", "blink"]
# }
Complete Verification Examples
cURL
Node.js
Python
curl -X POST https://api.secretcircle.com/v1/session/complete \
-H "x-api-key: sk_live_123456789" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "req_8f92bd",
"token": "tok_991823",
"analysis": {
"descriptor": [0.12, -0.04, 0.99],
"referencePhoto": "data:image/jpeg;base64,/9j/4AAQSkZJ..."
}
}'
Expected Response
{
"verified": true, // Boolean: True if liveness & face matching passed
"isDuplicate": false, // Boolean: True if the face already exists (if duplicates restricted)
"error": "..." // String: Present only if verification fails
}