Skip to content

Update Face Authen ​

Replaces the images enrolled in an existing face profile. Use it when a user's appearance has changed enough to hurt match rates, or to re-enrol after a poor initial capture.

Endpoint ​

http
POST /v1/update_face_auth
Content-Type: application/json
json
{
  "user_id": "user_00000001",
  "faces": [
    { "id": "a4facba3-334b-41fb-97e3-4766cb70ae29" }
  ],
  "device_id": "device_00000001",
  "app_id": "app_00000001",
  "lat": "10.7769",
  "lng": "106.7009",
  "face_type": "selfie",
  "metadata": { "key2": "value2" }
}

Parameters:

ParamTypeRequiredDefaultDescription
user_idstringYes—User ID of the customer.
facesImageData[]Yes—Images of the user's selfie, or a document containing a selfie photo. At least one is required.
device_idstringNo—The user's device ID, shown in face auth history on the admin portal.
app_idstringNo—The app the customer used, shown in face auth history.
latstringNo—Latitude of the device used for this update.
lngstringNo—Longitude of the device used for this update.
face_typestringNoselfieType of face input: selfie or id_card. Use id_card for a face extracted from a Citizen ID card.
metadatajson_objectNo—Any key-value metadata to store with this customer.

ImageData ​

ParamTypeRequiredDefaultDescription
idstringNo—ID of the image returned by Upload Image.
base64stringNo—Base64-encoded text of the image data.
labelstringNo—Label of the image, as described in Usage Recommendations.
metadatastring_jsonNo—Key/value JSON string. Example: {"gesture":"left","type":1}

Supply either id or base64, never both. CAKE recommends id over base64.

Returns: UpdateFaceAuthResponse

Sample Request ​

bash
curl -X POST \
  '<BASE_URL>/v1/update_face_auth' \
  -H 'Authorization: ATV <ACCESS_ID>:<SIGNATURE>' \
  -H 'X-TV-Timestamp: <TIMESTAMP>' \
  -H 'Content-Type: application/json' \
  -d '{
    "user_id": "user_00000001",
    "faces": [
      { "id": "a4facba3-334b-41fb-97e3-4766cb70ae29" }
    ],
    "face_type": "selfie",
    "device_id": "device_00000001",
    "app_id": "app_00000001",
    "lat": "10.7769",
    "lng": "106.7009",
    "metadata": {
      "key1": { "key11": "value11", "key12": "value12" },
      "key2": "value2"
    }
  }'

Response ​

json
{
  "data": {
    "status": "success",
    "request_id": "cfc7b8d5-f2e2-437b-80e5-d600dfad26e2",
    "face_auth": {
      "user_id": "user_00000001",
      "status": "VERIFIED"
    }
  },
  "errors": [],
  "success": true,
  "code": 0,
  "message": "Success"
}
FieldTypeDescription
data.statusstringsuccess or failure.
data.request_idstringRequest ID; quote it to CAKE Support when checking logs.
data.face_auth.user_idstringThe user ID the profile belongs to.
data.face_auth.statusstringProfile status after the update.

WARNING

Updating replaces the biometric template every future authentication is matched against. Gate this endpoint behind a strong authentication of its own — an attacker who can call it for another user's user_id can enrol their own face and take over the account.

Errors ​

Update runs the same quality and matching gate as registration:

CodeMessage
2001003Image sent to the server has no faces.
2001006Faces detected from images sent to the server are not matched.
2001009Image sent to the server has multiple faces.
2001010Access ID not found.
2001011Verify selfie / id_card liveness failed.
2001012Verify selfie / id_card sanity failed.
2001014Register rate limit exceeded.
2001015Register brute force limit exceeded.
2001025Selfie image sent to the server has length not equal to configuration.
2001026Images sent to server are duplicated.
401100You are not authorized to perform the action.
4001000Input parameter violates a constraint.
4001001The X-TV-Timestamp header is expired, need a newer one.
4001002Selfie or original image have more than 1 faces.
4041000The image ID is not found in DB.
4041001User not found.
4131000The input image size exceeds the allowed limit (15MB).
4151000The provided image format is not supported (JPG/PNG).
4291000The number of requests exceeded your throughput limit.
5001000Some unexpected error occurs while processing the request.
CodeDescription
access_id_not_foundAccess ID not found.
register_rate_limit_exceededRegister rate limit exceeded.
register_brute_force_limit_exceededRegister brute force limit exceeded.
access_denied_exceptionYou are not authorized to perform the action.
invalid_parameter_exceptionInput parameter violates a constraint.
request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.
incorrect_number_of_facesSelfie or original image have more than 1 faces.
image_not_found_exceptionThe image ID is not found in DB.
image_too_large_exceptionThe input image size exceeds the allowed limit (15MB).
invalid_image_format_exceptionThe provided image format is not supported (JPG/PNG).
rate_limit_exceptionThe number of requests exceeded your throughput limit.
duplicated_imageImages sent to server are duplicated.
selfie_image_invalidSelfie image sent to the server has length not equal to configuration.
sanity_check_failedVerify selfie / id_card sanity failed.
liveness_check_failedVerify selfie / id_card liveness failed.
image_has_no_facesImage sent to the server has no faces.
image_has_multiple_facesImage sent to the server has multiple faces.
compare_faces_not_matchedFaces detected from images sent to the server are not matched.
internal_server_errorSome unexpected error occurs while processing the request.

Unlike registration, update has no user_already_registered or face_already_registered failure — the profile is expected to exist.

Next Steps ​

Developers