Navigation

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 one thing: a reference photo for a KYC challenge. 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 the photo. 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.

Parameters


kyc.reference_image string

A base64-encoded JPEG or PNG under 5 MB showing exactly one face.


Returns


Returns the evaluation object.

Errors


400

The image is missing, not base64, not a JPEG or PNG, or over 5 MB.


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.


422 reference_image_no_face or reference_image_multiple_faces

The photo must show exactly one face.

POST/v3/evaluations/:id/enrich
import axios from 'axios';
import { readFile } from 'node:fs/promises';

const photo = await readFile('reference.jpg');

const { data } = await axios.post(
  'https://api.rupt.dev/v3/evaluations/EVALUATION_ID/enrich',
  { kyc: { reference_image: photo.toString('base64') } },
  { headers: { Authorization: `Bearer ${API_SECRET}` } }
);
Response
{
  "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": "selfie",
      "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"
}