Skip to main content

Create a Person with Liveness

Endpoint

POST https://api.verifik.co/v2/face-recognition/persons/search-live-face

Creates or updates a person after liveness checks on the submitted face image(s), a similarity search against your index (min_score, search_mode), and deduplication scoped to the target collection_id. If a duplicate is found in that collection (in production), the API may return 409:duplicated_person.

Headers

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Params

NameTypeRequiredDescription
namestringYesFull name (digits are stripped server-side)
imagesstring[]YesBase64 face images (raw base64, not data URLs)
genderstringYesM or F
date_of_birthstringYesDate of birth in the format required by OpenCV validation (typically YYYY-MM-DD)
nationalitystringNoOptional nationality
collection_idstringYesUnique _id of the collection to enroll into (and to check for duplicates)
liveness_min_scorenumberYesMinimum liveness score, between 0.5 and 1
min_scorenumberYesMinimum face match score for the internal search, between 0.5 and 1
search_modestringYesFAST or ACCURATE

Request

const fetch = require("node-fetch");

const collectionId = "65b9592267cc4f096dbe743d";

async function run() {
const res = await fetch(
"https://api.verifik.co/v2/face-recognition/persons/search-live-face",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
name: "Jane Doe",
gender: "F",
date_of_birth: "1990-01-15",
nationality: "CO",
collection_id: collectionId,
liveness_min_score: 0.65,
min_score: 0.8,
search_mode: "FAST",
images: ["<base64>", "<base64>"],
}),
}
);
console.log(await res.json());
}

run();

Response

{
"id": "…",
"data": {
"_id": "65175da13e81e4fabc12345",
"name": "Jane Doe",
"gender": "F",
"date_of_birth": "1990-01-15T00:00:00.000Z",
"collections": ["65b9592267cc4f096dbe743d"],
"deleted": false,
"createdAt": "2024-01-30T20:16:34.841Z",
"updatedAt": "2024-01-30T20:16:34.841Z"
},
"signature": {
"message": "Certified by Verifik.co",
"dateTime": "…"
}
}

Notes

  • Not POST /v2/face-recognition/persons/liveness — the correct route is search-live-face under persons.
  • collection_id: single collection _id (this flow does not accept a collections array in the request body).
  • Liveness failure: sub-scores may surface as 409 with a message containing liveness_failed.
  • liveness_min_score and min_score must stay between 0.5 and 1; search_mode must be FAST or ACCURATE.
  • images must be raw base64 (no data: URL); undersized payloads may return 412 only_images_in_base64.