Enrollment
Enroll a face
POST
/registries/{registryId}/profiles/{profileId}/faceEnroll from your own capture. Liveness runs; returns enrolled or 422 liveness_failed.
curl -X POST "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -F image=@face.jpg
// Node.js 18+, ES module (built-in fetch and FormData) import { readFile } from 'node:fs/promises'; const form = new FormData(); form.append('image', new Blob([await readFile('face.jpg')]), 'face.jpg'); const res = await fetch('https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face', { method: 'POST', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), }, body: form, }); const data = await res.json();
import os, uuid, requests res = requests.post( "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, files={"image": open("face.jpg", "rb")}, timeout=15, ) res.raise_for_status() data = res.json()
curl -X POST "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -F image=@face.jpg
// Node.js 18+, ES module (built-in fetch and FormData) import { readFile } from 'node:fs/promises'; const form = new FormData(); form.append('image', new Blob([await readFile('face.jpg')]), 'face.jpg'); const res = await fetch('https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face', { method: 'POST', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), }, body: form, }); const data = await res.json();
import os, uuid, requests res = requests.post( "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, files={"image": open("face.jpg", "rb")}, timeout=15, ) res.raise_for_status() data = res.json()
curl -X POST "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face" \ -H "Authorization: Bearer $FACETRUST_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -F image=@face.jpg
// Node.js 18+, ES module (built-in fetch and FormData) import { readFile } from 'node:fs/promises'; const form = new FormData(); form.append('image', new Blob([await readFile('face.jpg')]), 'face.jpg'); const res = await fetch('https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face', { method: 'POST', headers: { Authorization: `Bearer ${process.env.FACETRUST_API_KEY}`, 'Idempotency-Key': crypto.randomUUID(), }, body: form, }); const data = await res.json();
import os, uuid, requests res = requests.post( "https://api.facetrustai.com/v1/registries/3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c/profiles/7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57/face", headers={"Authorization": f"Bearer {os.environ['FACETRUST_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, files={"image": open("face.jpg", "rb")}, timeout=15, ) res.raise_for_status() data = res.json()
200 · application/json
{
"status": "enrolled",
"profile": {
"id": "7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57",
"primaryKey": "CFU/24/1068",
"fullName": "Adaeze Okafor",
"phone": "+2348030000000",
"email": "adaeze@example.com",
"fields": {
"faculty": "Sciences",
"department": "Computer Science",
"level": "300",
"hostel_block": "Block B"
},
"registryId": "3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c",
"enrollmentStatus": "enrolled",
"enrolledAt": "2026-10-02T14:20:11Z",
"createdAt": "2026-09-28T08:00:00Z",
"updatedAt": "2026-11-19T09:12:40Z"
}
}200 · application/json
{
"status": "enrolled",
"profile": {
"id": "7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57",
"primaryKey": "NBL-00344",
"fullName": "Adaeze Okafor",
"phone": "+2348030000000",
"email": "adaeze@example.com",
"fields": {
"department": "Operations",
"job_title": "Fleet Supervisor",
"access_level": "Standard",
"manager_email": "ops.lead@example.com"
},
"registryId": "3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c",
"enrollmentStatus": "enrolled",
"enrolledAt": "2026-10-02T14:20:11Z",
"createdAt": "2026-09-28T08:00:00Z",
"updatedAt": "2026-11-19T09:12:40Z"
}
}200 · application/json
{
"status": "enrolled",
"profile": {
"id": "7c1e2a4b-5d3f-4e8a-9b21-0f6d8c3e1a57",
"primaryKey": "TKT-88123",
"fullName": "Adaeze Okafor",
"phone": "+2348030000000",
"email": "adaeze@example.com",
"fields": {
"pass_type": "VIP",
"seat_number": "A12",
"event_date": "2026-11-19"
},
"registryId": "3f9a1c2e-7b4d-4e6a-9c8b-2d1e0f5a6b7c",
"enrollmentStatus": "enrolled",
"enrolledAt": "2026-10-02T14:20:11Z",
"createdAt": "2026-09-28T08:00:00Z",
"updatedAt": "2026-11-19T09:12:40Z"
}
}Use it for
Registration desks that already photograph people.
Headers#
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <key>, a key with the enrollment:write scope. See Authentication. |
Idempotency-Key | No | A UUID you generate. Retrying with the same key returns the original result. See Conventions. |
Content-Type | Yes | multipart/form-data |
Path parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
registryId | uuid | Yes | Your registry. Shown on this page and in the console under Registry. |
profileId | uuid | Yes | The person’s ID, returned when you create or look them up. |
Form fields (multipart)#
| Parameter | Type | Required | Description |
|---|---|---|---|
image | file | Yes | JPEG/PNG, one face, ≤ 2 MB recommended. |
Response#
Returns 200 with the body shown in the response example. Examples follow the account type selected at the top of the page.
Shown above, with the request.
Errors#
| Code | HTTP | Meaning |
|---|---|---|
unauthorized | 401 | Missing, malformed, revoked or expired API key. |
forbidden_scope | 403 | The key doesn’t have the scope this endpoint needs. |
account_type_forbidden | 403 | This endpoint isn’t available to your account type. |
module_disabled | 403 | The module is switched off for your account. Contact FaceTrust. |
ip_not_allowed | 403 | The request came from an IP outside the key’s allowlist. |
rate_limited | 429 | Too many requests. Wait for Retry-After seconds. |
not_found | 404 | No such resource in your institution. |
liveness_failed | 422 | The image failed the liveness check. Includes referenceId. |
no_face_detected | 422 | No face was found in the image. |
multiple_faces_detected | 422 | More than one face was found in the image. |
duplicate_face | 409 | This face is already enrolled for another person in the registry. Includes match. |