Index Faces (Rekognition)
Index a face into the AWS Rekognition collection via JSON — image, bucket, image_key, external_image_id. POST /index_faces with Bearer auth.
API reference
JWT Bearer token authentication. Obtain a token from the KwikID dashboard.
In: header
Base64-encoded image (raw or data URL).
S3 bucket name.
Object key in the bucket.
External id stored with the face record.
Response Body
curl -X POST "https://__mock__/index_faces" \ -H "Content-Type: application/json" \ -d '{ "image": "string", "bucket": "string", "image_key": "string", "external_image_id": "string" }'{
"success": true,
"message": "string",
"data": {}
}{
"msg": "string"
}{
"detail": {},
"message": "string"
}Overview
Call POST /index_faces with Authorization: Bearer <token> and application/json. Required body fields are image (base64), bucket, image_key, and external_image_id. The server must have AWS Rekognition and related configuration enabled.
Key features
- Searchable gallery: Indexes a face for later search and duplicate checks when your deployment uses the Rekognition collection.
Implementation
Step 1: Build the JSON payload
Include required fields image, bucket, image_key, and external_image_id as described in the OpenAPI schema.
Step 2: Send the request from your backend
POST /index_faces HTTP/1.1
Host: <machine-learning-api-base-url>
Authorization: Bearer <token>
Content-Type: application/jsonStep 3: Handle the response
On 200 OK, read success, message, and data from the JSON body. On 400, read msg.
Error handling
| HTTP status | When |
|---|---|
| 400 | Invalid body, AWS error, or processing failure. |
| 401 | Invalid token. |
Benefits
- Centralizes face indexing for downstream face-search workflows.
Next steps
Advanced Facematch POST
Structured 1-photo or 2-photo flow — per-image liveness plus optional face match. POST /advanced_facematch with Bearer auth.
Delete Faces from Collection POST
Remove a face from the AWS Rekognition collection by bucket and external_image_id. POST /delete_faces_from_collection with Bearer auth.