Skip to main content

Face Recognition

The Face Recognition endpoints work directly with face images: enroll a face for a person, detect faces in an image, compare two faces, and check whether an enrollment image reference already exists.

Enrollment is how identities get faces

faceEnroll is the REST entry point for creating a person from a face (or attaching another photo to an existing person). Use it together with Person Management to fill in names, tags, and attributes.

API Endpoints

  • Base URL (Cloud): https://customername.econnectcloud.com/identities
  • Base URL (On-prem): https://<server-host-or-ip>:5009
MethodEndpointDescriptionPermission
POST/api/v1/faces/faceEnrollEnroll a face — create a person or add a photo to one.Face Enrollment
POST/api/v1/faces/faceDetectDetect faces in an image.Face Detection
POST/api/v1/faces/faceCompareCompare two faces (1:1).Face Detection
GET/api/v1/faces/checkImageReference/{referenceId}Check whether an enrollment image reference exists.Face Detection

Authentication

Requires a JWT bearer token. See Authentication.

Permissions

The permission names and category below are what you'll see in the Identities web app under System → System settings → Roles.

OperationPermissionCategory
faceEnrollFace EnrollmentFacial Recognition Services
faceDetect / faceCompare / checkImageReferenceFace DetectionFacial Recognition Services

Code Examples

API_URL="https://customername.econnectcloud.com/identities"
TOKEN="your_jwt"
IMG_B64=$(base64 -w 0 face.jpg)

# Enroll a face - creates a NEW person and returns its personId
curl -sk -X POST "$API_URL/api/v1/faces/faceEnroll" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"faceImage\": \"$IMG_B64\", \"photoReferenceId\": \"ext-123\"}" | jq
# Add a face to an EXISTING person instead:
# POST "$API_URL/api/v1/faces/faceEnroll?personId=<personId>&forceEnrollment=false"

# Detect faces in an image
curl -sk -X POST "$API_URL/api/v1/faces/faceDetect" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"image\": \"$IMG_B64\"}" | jq

# Compare two faces (1:1)
IMG2_B64=$(base64 -w 0 face2.jpg)
curl -sk -X POST "$API_URL/api/v1/faces/faceCompare" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"image1\": \"$IMG_B64\", \"image2\": \"$IMG2_B64\"}" | jq

# Check whether an enrollment image reference already exists
curl -sk -X GET "$API_URL/api/v1/faces/checkImageReference/ext-123" \
-H "Authorization: Bearer $TOKEN" | jq

Enroll a Face

  • Method / Path: POST /api/v1/faces/faceEnroll
  • Query parameters:
    • personId (optional, GUID) — attach the face to this existing person. Omit to create a new person.
    • forceEnrollment (optional, bool, default false) — enroll even if quality checks would normally reject the image.

Request Body

FieldTypeDescription
faceImagebyte[] (base64)The face image to enroll.
photoReferenceIdstringOptional caller-supplied reference id for the image (used by checkImageReference).

Response

{ "personId": "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d" }

When no personId is supplied a new person is created and returned; if enrollment fails, that just-created person is rolled back automatically.

Detect Faces

  • Method / Path: POST /api/v1/faces/faceDetect
  • Body: { "image": "<base64>" }
{
"detections": [
{
"faceId": "5f9c2b7a-3e41-4d8a-9b6c-1a2b3c4d5e6f",
"personId": "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"confidence": 0.981,
"quality": 0.93,
"boundingBox": { "x": 320, "y": 145, "width": 96, "height": 96 }
}
]
}

personId is null when the detected face doesn't match a known person.

Compare Faces

  • Method / Path: POST /api/v1/faces/faceCompare
  • Body: { "image1": "<base64>", "image2": "<base64>" }
{ "match": true, "confidence": 0.97 }

Check Image Reference

  • Method / Path: GET /api/v1/faces/checkImageReference/{referenceId}
{ "exists": true, "faceId": "5f9c2b7a-...", "detectId": "c1d2e3f4-..." }

Response Codes

CodeMeaning
200 OKThe operation succeeded.
404 Not Found(faceEnroll) the supplied personId was not found.
401 UnauthorizedMissing or invalid JWT.
403 ForbiddenThe user lacks the required Facial Recognition Services permission.
500 Internal Server ErrorA server-side error occurred (e.g. image rejected).