API reference

Enrol a face

Add a face to a collection so it can be searched for or recognised later.

POST /v1/face-embeddings/sync1 operation per face enrolled

Request

multipart/form-data, with your key as a bearer token.

FieldTypeDefaultDescription
imagerequiredfileAn image containing one face.
unique_namestringYour own identifier for this person. Use it to reconcile with your records.
full_namestringDisplay name.
collectionstringdefaultNamed collection to file this face under.
metadatastringFree-form string stored alongside the face.
check_duplicatebooleantrueRefuse the enrolment if this person is already in the collection.
duplicate_thresholdnumber0.98Match score above which a face counts as already enrolled.

Example

curl -X POST https://api.quantilence.com/v1/face-embeddings/sync \
  -H "Authorization: Bearer $QUANTILENCE_API_KEY" \
  -F "image=@photo.jpg" \
  -F "unique_name=alex-morgan" \
  -F "full_name=Alex Morgan" \
  -F "collection=default" \
  -F "metadata=" \
  -F "check_duplicate=true" \
  -F "duplicate_threshold=0.98"

Response

200 OK with this shape. Values below are illustrative; the keys and types are not.

{
  "success": true,
  "status": "enrolled",
  "face_id": 4127,
  "user_id": "8f14e45f-ceea-467a-9f2b-1c7d9c0a5e21",
  "collection": "staff",
  "image_filename": "alex.jpg",
  "crop_b64": "/9j/4AAQSkZJRg…",
  "embedding_dims": 512,
  "det_score": 0.938,
  "message": null,
  "duplicate": null
}
FieldTypeDescription
successbooleanWhether the request was handled.
statusstring`enrolled`, `duplicate_found`, `no_face` or `error`. Check this, not `success`.
face_idinteger | nullThe enrolled face's id.
user_idstringThe account it was filed under.
collectionstringCollection it went into.
image_filenamestringThe filename you sent.
crop_b64string | nullAligned crop of the enrolled face.
embedding_dimsinteger | nullEmbedding size.
det_scorefloat | nullDetector confidence.
messagestring | nullHuman-readable detail.
duplicateobject | nullThe existing face, when one matched.

Worth knowing

  • Read `status`, not `success`. A duplicate or a face-less image returns 200 with `success: true` and a status that says what happened.
  • Enrolling the same person twice is refused by default — set `check_duplicate` to false only if you mean it.