Nodeflux Central
Face Enrollment

API Reference — Face Enrollment

Endpoint untuk mengelola data Face Enrollment, NIK, custom field, alias, dan pencarian massal.

Semua endpoint memerlukan header Authorization: Bearer <token>. Basis URL mengikuti variabel lingkungan VITE_API_URL yang dikonfigurasi pada instalasi Lenz. Jika Anda belum punya token, lihat halaman Otentikasi.


CRUD Enrollment

Endpoint utama untuk membuat, membaca, memperbarui, dan menghapus data enrollment satu per satu.

GET
/api/enrollment

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

page?integer

Nomor halaman, dimulai dari 1

Default1
limit?integer

Jumlah data per halaman

Default10
search?string

Pencarian berdasarkan nama atau nomor identitas

filter[status]?string

Filter berdasarkan status enrollment

filter[face_id]?string

Filter berdasarkan face_id tertentu

filter[custom_fields.<key>]?string

Filter berdasarkan nilai custom field tertentu

sortBy?string

Kolom untuk pengurutan

Default"id"
descending?boolean

Urutan menurun jika true

Defaulttrue

Response Body

application/json

curl -X GET "https://lenz.example.com/api/enrollment"
{  "ok": true,  "message": "succesfully get enrolled person",  "results": {    "limit": 20,    "current_page": 1,    "total_data": 1,    "total_page": 1,    "enrollments": [      {        "id": 1,        "name": "Budi Santoso",        "identity_number": "3201xxxxxxxxxxxx",        "gender": "male",        "birth_place": "Jakarta",        "birth_date": "1990-05-20",        "status": "whitelist",        "face_id": "abc123def456",        "alias_names": [          "Budi"        ],        "faces": [          {            "id": 1,            "enrolled_face_id": 1,            "variation": "1234567890",            "created_at": "2024-01-01T00:00:00Z"          }        ],        "custom_field": {},        "created_at": "2024-01-01T00:00:00Z",        "updated_at": "2024-01-01T00:00:00Z",        "deleted_at": null      }    ]  }}
POST
/api/enrollment

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://lenz.example.com/api/enrollment" \  -F name="string" \  -F identity_number="string" \  -F images="[    \"string\"  ]"
{  "ok": true,  "message": "Successfully enroll new person",  "enrollment": {    "id": 42,    "name": "Budi Santoso",    "identity_number": "3201xxxxxxxxxxxx",    "face_id": "abc123def456",    "keyspace": "default",    "created_at": "2024-06-01T08:00:00Z",    "updated_at": "2024-06-01T08:00:00Z",    "deleted_at": null,    "faces": [      {        "id": 10,        "variation": "9876543210",        "image": "<base64>"      }    ]  }}
GET
/api/enrollment/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*integer

ID numerik enrollment

Response Body

application/json

curl -X GET "https://lenz.example.com/api/enrollment/0"
{  "ok": true,  "message": "Succesfully get detail enrolled faces",  "enrollment": {    "id": 42,    "name": "Budi Santoso",    "identity_number": "3201xxxxxxxxxxxx",    "gender": "male",    "birth_place": "Jakarta",    "birth_date": "1990-05-20",    "status": "whitelist",    "face_id": "abc123def456",    "alias_names": [      "Budi"    ],    "faces": [      {        "id": 10,        "enrolled_face_id": 42,        "variation": "9876543210",        "created_at": "2024-06-01T08:00:00Z"      }    ],    "custom_field": {      "departemen": "IT"    },    "created_at": "2024-06-01T08:00:00Z",    "updated_at": "2024-06-01T08:00:00Z",    "deleted_at": null  }}
PUT
/api/enrollment/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*integer

ID numerik enrollment

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PUT "https://lenz.example.com/api/enrollment/0" \  -F name="string" \  -F identity_number="string"
Empty
DELETE
/api/enrollment/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*integer

ID numerik enrollment

Response Body

application/json

curl -X DELETE "https://lenz.example.com/api/enrollment/0"
{  "ok": true,  "message": "succesfully enrolled person"}

Statistik & Status

Endpoint ringan untuk widget dashboard, filter status di toolbar, dan monitoring jumlah enrollment.

GET
/api/enrollment/total

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

instance?string

ID instance tertentu pada mode federation (opsional)

Response Body

application/json

curl -X GET "https://lenz.example.com/api/enrollment/total"
{  "ok": true,  "message": "success",  "total": 1250}
GET
/api/enrolled-faces/statuses

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://lenz.example.com/api/enrolled-faces/statuses"
{  "ok": true,  "message": "success",  "results": {    "total": 1250,    "statuses": [      {        "status": "whitelist",        "total": 800      },      {        "status": "blacklist",        "total": 150      },      {        "status": "normal",        "total": 300      }    ]  }}

Bulk Lookup

Endpoint untuk mengambil banyak enrollment sekaligus, biasanya dipakai pada halaman event atau hasil pencarian saat me-resolve face_id ke detail orang.

GET
/api/enrolled-faces/get-by-face-ids

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

face_ids*string

Daftar face_id dipisahkan koma

Response Body

application/json

curl -X GET "https://lenz.example.com/api/enrolled-faces/get-by-face-ids?face_ids=string"
{  "ok": true,  "message": "success",  "results": [    {      "id": 42,      "name": "Budi Santoso",      "identity_number": "3201xxxxxxxxxxxx",      "face_id": "abc123",      "status": "whitelist",      "faces": []    }  ]}

On this page