API Documentation

Facelify REST API Reference

Real-time face verification in under 200ms. Simple multipart REST API with secure x-api-key authentication.

<200ms

Average response time

Ultra-fast AWS Rekognition latency

99.9%

System uptime SLA

High availability REST infrastructure

3

Core endpoints

/register, /verify and the fast 1:N /identify

Authentication

Pass your API key in the x-api-key request header on every request. Keys begin with fv_key_.

x-api-key: fv_key_sandbox_xxxxxxxxxxxxxxxx

API Endpoints

POST/api/v1/register

Register user reference photo at onboarding.

riderId string (required)
image file (JPEG/PNG)
POST/api/v1/verify

Verify live selfie against reference photo.

riderId string (required)
image file (Live Selfie)
POST/api/v1/identifyNEW · 1:N

Answers “who is this?” in a single call. The photo is searched against every face your account has registered, so you no longer need to know the person in advance or call /verify once per person. Typical answer time is a fraction of a second, however many people are enrolled.

Request (multipart/form-data)

image file, JPEG/PNG up to 5 MB (required)
threshold 50–99.9, default 80
maxFaces 1–5, default 5

Register people once with /register (their riderId can be an employee id, driver id, customer id…). Registering also adds the face to the search index.

// 200 OK
{
  "success": true,
  "matched": true,
  "riderId": "emp_1042",
  "similarity": 97.4,
  "candidates": [
    { "riderId": "emp_1042", "similarity": 97.4 },
    { "riderId": "emp_2210", "similarity": 81.2 }
  ],
  "latencyMs": 412
}
// 409 { "code": "collection_empty" }  nobody registered yet
// 422 { "code": "no_face" }           no usable face in the photo

Billing is the same as a verify: charged only when somebody is recognised. If two candidates score very close, treat the result as unclear and ask for a PIN or another photo.

Where to use it

Pick the endpoint by the question you are asking: “is this who they say they are?” uses /verify; “who is this?” uses /identify.

Attendance machines & time clocks

/identify

A tablet or kiosk at the door: the employee looks at the camera, you call /identify with the photo, and the matching riderId is the employee to clock in or out. No PIN or card, and one call even with hundreds of staff.

Flow: Register staff once at onboarding → on every punch call /identify → record the attendance for riderId → fall back to a PIN if matched is false.

Driver / rider check-in

/verify

Before a driver starts a shift or accepts a trip, ask them to take a selfie and verify it against the photo on file. Stops account sharing.

Flow: Register the driver's photo at onboarding → at shift start call /verify with their riderId and a selfie → allow the shift only if verified is true.

Order & parcel handover

/verify

Confirm the person collecting an order (or the rider handing it over) is the right one: verify the live photo against the customer or rider on record.

Flow: Call /verify with the customer's or rider's id at the handover and attach the result to the order.

Door & gate access

/identify

Let enrolled people in without cards. Identify the face, then check that riderId against your access list.

Flow: Call /identify at the gate → open only if matched and the riderId is allowed for that door.

KYC & onboarding

/verify

Compare an ID-document photo with a live selfie to confirm the person is the document holder.

Flow: Register the document photo → verify the live selfie against it in the same flow.

Exam / shift proctoring

/verify

Re-check the same person at intervals during an exam or a long shift.

Flow: Call /verify every N minutes with the candidate's riderId and log any unverified result.

Tips for fast, reliable results

  • Send a small, clear photo (about 640×480 JPEG is plenty); it uploads faster and matches just as well.
  • Front-facing, well lit, one face in the frame. Photos with no face are refused at registration and are not charged.
  • Use the same riderId everywhere (for example company_user) so a match maps straight to your own record.
  • Re-registering a riderId replaces the old face.
  • Keep the API key on your server or in a secured kiosk setting, never in a public web page.

Response Schema & Status Codes

200 OK Response

{
  "success": true,
  "verified": true,
  "similarity": 98.4,
  "riderId": "rider_102"
}

Common HTTP Status Codes

200 OKFace comparison completed
400 Bad RequestMissing riderId or image file
401 / 403Unauthorized or Low Balance

Code Examples

1Register reference photoShell
curl -X POST https://facelify.online/api/v1/register \
  -H "x-api-key: fv_key_your_api_key" \
  -F "riderId=rider_102" \
  -F "image=@/path/to/rider_doc.jpg"
2Verify live selfie (is this who they say they are?)Shell
curl -X POST https://facelify.online/api/v1/verify \
  -H "x-api-key: fv_key_your_api_key" \
  -F "riderId=rider_102" \
  -F "image=@/path/to/live_selfie.jpg"
3Identify a face (who is this?)Shell
curl -X POST https://facelify.online/api/v1/identify \
  -H "x-api-key: fv_key_your_api_key" \
  -F "threshold=85" \
  -F "image=@/path/to/live_photo.jpg"