Skip to content

REST API Reference

Base URL: http://localhost:8080 (default)

Biometric operation endpoints (/api/v1/search, /api/v1/verify, /api/v1/enrol, /api/v1/delete) accept multipart/form-data with an image file part and a metadata JSON part, and return XML responses. Utility endpoints return JSON.


1:N face search. Runs the probe image through the full pipeline (detection → alignment → PAD → quality → extraction) and searches the FAISS index for the closest matches.

Request (multipart/form-data)

PartTypeRequiredDescription
imagefileyesJPEG or PNG face image
metadataJSON stringnoSearch parameters (see below)
Terminal window
curl -X POST http://localhost:8080/api/v1/search \
-F image=@probe.jpg \
-F 'metadata={"partition":"default","top_k":5,"threshold":0.4}'

Metadata fields

FieldTypeDefaultDescription
partitionstring"default"Gallery partition to search
top_kinteger5Maximum candidates to return
thresholdfloat0.45Minimum similarity score (0–1)

Response (XML)

<SearchResponse>
<status>OK</status>
<candidates>
<candidate>
<subject_id>person-001</subject_id>
<score>0.823</score>
<rank>1</rank>
</candidate>
<candidate>
<subject_id>person-042</subject_id>
<score>0.611</score>
<rank>2</rank>
</candidate>
</candidates>
<quality_score>0.87</quality_score>
<model_id>arcface-w600k-r50</model_id>
</SearchResponse>

Error responses

HTTP statusReason
400No face detected, or image failed to decode
422Quality gate rejected the image (score below threshold)
451PAD gate rejected the image (spoof detected)

1:1 verification. Compares the probe image against a specific enrolled subject.

Request (multipart/form-data)

Terminal window
curl -X POST http://localhost:8080/api/v1/verify \
-F image=@probe.jpg \
-F 'metadata={"subject_id":"person-001","partition":"default"}'

Metadata fields

FieldTypeRequiredDescription
subject_idstringyesSubject to verify against
partitionstringnoGallery partition (default: "default")
thresholdfloatnoMatch threshold (default: 0.45)

Response (XML)

<VerifyResponse>
<status>OK</status>
<match>true</match>
<score>0.823</score>
<subject_id>person-001</subject_id>
<quality_score>0.87</quality_score>
<model_id>arcface-w600k-r50</model_id>
</VerifyResponse>

Enrol a new face into the gallery. Runs detection → alignment → PAD → MAD → quality → extraction, then stores the 512-dim template.

Request (multipart/form-data)

Terminal window
curl -X POST http://localhost:8080/api/v1/enrol \
-F image=@photo.jpg \
-F 'metadata={"subject_id":"person-001","partition":"default"}'

Metadata fields

FieldTypeRequiredDescription
subject_idstringyesUnique identifier for this subject
partitionstringnoGallery partition (default: "default")

Response (XML)

<EnrolResponse>
<status>OK</status>
<subject_id>person-001</subject_id>
<quality_score>0.91</quality_score>
<model_id>arcface-w600k-r50</model_id>
</EnrolResponse>

Remove a subject’s template from the gallery. No image required.

Request (application/json)

Terminal window
curl -X POST http://localhost:8080/api/v1/delete \
-H 'Content-Type: application/json' \
-d '{"subject_id":"person-001","partition":"default"}'

Response (XML)

<DeleteResponse>
<status>OK</status>
<subject_id>person-001</subject_id>
</DeleteResponse>

Returns the health status of all system components.

Response (JSON)

{
"status": "healthy",
"components": {
"faiss_index": true,
"onnx_detection": true,
"onnx_recognition": true,
"onnx_quality": true,
"onnx_pad": true
}
}

Returns HTTP 503 if any component is unhealthy.


List available gallery partitions.

Response (JSON)

{
"partitions": ["default", "watchlist", "employees"]
}

Return gallery statistics.

Response (JSON)

{
"total_subjects": 1423,
"partitions": {
"default": 1200,
"watchlist": 223
}
}