Face Matching
Compliance Screening
Face Matching
POST
Face Matching
Biometric face matching API for identity verification using AWS Rekognition. Supports 1:1 face verification, 1:N face search, face registration, and blacklist management.
Contact support to modify these settings for your tenant.
Overview
The Face Matching API provides comprehensive biometric verification capabilities:- 1:1 Verification: Compare two face images to verify identity
- 1:N Search: Search for a face in the registered collection
- Face Registration: Register faces in tenant-specific collections
- Blacklist Management: Flag faces for fraud prevention
- Presigned Uploads: Secure direct-to-S3 image uploads
Face matching must be enabled for your tenant. Contact support to enable this feature.
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/kyc/facematch/verify | POST | 1:1 face verification |
/kyc/facematch/register | POST | Register face in collection |
/kyc/facematch/search | POST | 1:N face search |
/kyc/facematch/blacklist | POST | Add face to blacklist |
/kyc/facematch/faces/{face_id} | DELETE | Delete face from collection |
/kyc/facematch/collections/status | GET | Get collection status |
/kyc/facematch/upload-url | POST | Generate presigned upload URL |
Authentication
All endpoints require Bearer token authentication. Required permissions vary by endpoint:| Endpoint | Required Permission |
|---|---|
| Verify | kyc:read |
| Register | kyc:create |
| Search | kyc:read |
| Blacklist | kyc:create |
| Delete | kyc:create |
| Collection Status | kyc:read |
| Upload URL | kyc:create |
1:1 Face Verification
Compare two face images to determine if they belong to the same person.Request Parameters
Request Example
Using S3 Images
Response
Response Fields
| Field | Type | Description |
|---|---|---|
is_match | boolean | Whether faces match (similarity >= threshold) |
similarity_score | number | Similarity score (0.0-1.0) |
confidence | number | Confidence level of the comparison (0.0-1.0) |
processing_time_ms | integer | Processing time in milliseconds |
Face Registration
Register a face in the tenant’s collection for future searches.Request Parameters
Request Example
Response
Response Fields
| Field | Type | Description |
|---|---|---|
face_id | string | Unique face identifier |
rekognition_face_id | string | AWS Rekognition face ID |
s3_key | string | S3 key where face image is stored |
message | string | Success message |
1:N Face Search
Search for a face across all registered faces in the tenant’s collection.Request Parameters
Request Example
Response
Response Fields
| Field | Type | Description |
|---|---|---|
matches | array | List of matching faces |
total_matches | integer | Total number of matches found |
search_time_ms | integer | Search time in milliseconds |
Match Fields
| Field | Type | Description |
|---|---|---|
face_id | string | Unique face identifier |
session_id | string | Associated KYC session ID |
similarity | number | Similarity score (0.0-1.0) |
metadata | object | Stored metadata |
is_blacklisted | boolean | Whether face is blacklisted |
blacklist_reason | string | Reason for blacklisting (if applicable) |
Add to Blacklist
Mark a registered face as blacklisted for fraud prevention.Request Parameters
Request Example
Response
Delete Face
Remove a registered face from the collection.Path Parameters
| Parameter | Type | Description |
|---|---|---|
face_id | string | Face ID to delete |
Request Example
Response
Collection Status
Get status information about the tenant’s face collection.Request Example
Response
Response Fields
| Field | Type | Description |
|---|---|---|
collection_name | string | AWS Rekognition collection name |
face_count | integer | Number of registered faces |
status | string | Collection status (ACTIVE, CREATING, etc.) |
Generate Upload URL
Generate a presigned URL for direct S3 image upload.Request Parameters
Request Example
Response
Response Fields
| Field | Type | Description |
|---|---|---|
upload_url | string | Presigned URL for uploading |
s3_uri | string | S3 URI for use in other endpoints |
s3_key | string | S3 key where image will be stored |
expires_at | integer | Unix timestamp when URL expires |
Upload Workflow
- Request a presigned upload URL
- Upload image directly to S3 using the presigned URL
- Use the returned
s3_uriin register/verify/search endpoints withimage_format: "s3"
Error Responses
400 Bad Request
403 Forbidden - Feature Not Enabled
403 Forbidden - Permission Denied
404 Not Found
400 Bad Request - No Face Detected
400 Bad Request - Max Faces Exceeded
Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created (registration) |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Missing or invalid token |
| 403 | Forbidden - Feature not enabled or insufficient permissions |
| 404 | Not Found - Face not found |
| 500 | Internal Server Error |
Usage Examples
Python Example - Complete Verification Flow
JavaScript Example
Tenant Configuration
Face matching behavior is configured per tenant:| Setting | Default | Description |
|---|---|---|
enabled | false | Whether face matching is enabled |
verification_threshold | 0.6 | Default threshold for 1:1 verification |
search_threshold | 0.8 | Default threshold for 1:N search |
max_faces_per_user | 5 | Maximum faces per session |
enable_blacklist | true | Enable blacklist functionality |
model_version | Rekognition | Face detection model |
Best Practices
Image Quality
- Use high-quality images (minimum 640x480 pixels)
- Ensure good lighting with face clearly visible
- Avoid heavily compressed images
- Face should occupy at least 20% of the image
Security
- Use presigned URLs for large images to avoid base64 overhead
- Store face IDs securely - they link to biometric data
- Implement rate limiting on verification endpoints
- Review blacklist matches with human oversight
Performance
- Use S3 image format for large images (>1MB)
- Keep
max_resultsreasonable in searches - Cache collection status if needed frequently
- Batch registrations when onboarding multiple users
Compliance
- Inform users about biometric data collection
- Implement data retention policies
- Provide mechanism for users to request data deletion
- Log all face matching operations for audit trails