Enrich an evaluation Experimental
Add information to an evaluation from your server. The browser never sees or sends this data, so the user cannot tamper with it. This endpoint is experimental and may change.
Today it accepts what you already know about the user for a KYC challenge: a reference photo, their name and address, or both. When the evaluation's verdict is a KYC challenge, send a photo you already trust for this user. The live selfie must then match that photo for the challenge to complete, which proves the person in front of the camera is this specific person and not just a live one.
Call it while the challenge is still pending, before the user finishes the selfie. Calling it again replaces what you sent before. Rupt holds the photo for at most 24 hours and deletes it as soon as the challenge completes or fails.
A selfie that does not match spends one attempt with the reason reference_mismatch. Read challenge.kyc.reference_matched on the evaluation or the challenge to confirm the match happened.
On a document level challenge you can also send the name and address you have on file, and Rupt compares them with the ID. A name that does not match fails the challenge right away with the reason reference_name_mismatch. City and state are compared but never fail it. If the ID's name can't be read, the user is asked to retake the photo. Read challenge.kyc.reference_field_matches for how each field matched. Rupt stores these fields encrypted.
Parameters
kyc.reference_image string (optional)
A base64-encoded JPEG or PNG under 5 MB showing exactly one face.
kyc.reference_fields object (optional)
Any of first_name, middle_name, last_name, city_in_address and state_in_address, each up to 100 characters. Send this, reference_image or both.
Returns
Returns the evaluation object.
Errors
400
Neither field was sent, the image is not a base64 JPEG or PNG under 5 MB, or reference_fields has a field not listed above.
404
No evaluation with this id in your secret's environment.
409 kyc_challenge_not_pending
The evaluation has no KYC challenge, or the challenge already completed or failed.
409 kyc_document_level_required
reference_fields was sent for a selfie level challenge, which reads no ID.
422 reference_image_no_face or reference_image_multiple_faces
The photo must show exactly one face.
const evaluation = await rupt.enrichEvaluation(EVALUATION_ID, {
reference_fields: { first_name: 'Jane', last_name: 'Doe' },
});
{
"id": "649873be6e8b6f9b33722a0c",
"action": "login",
"verdict": "challenge",
"user": {
"rupt_id": "649873be6e8b6f9b33722a0c",
"id": "external_account_id",
"email": "user@example.com",
"suspended": false
},
"challenge": {
"id": "649873be6e8b6f9b33722a0d",
"status": "presented",
"type": "kyc",
"kyc": {
"level": "document",
"reasons": [],
"reference_matched": false
},
"createdAt": "2021-09-01T00:00:00.000Z"
},
"createdAt": "2021-09-01T00:00:00.000Z",
"updatedAt": "2021-09-01T00:00:00.000Z"
}