Navigation
Consume an evaluation
Consume an evaluation to mark it as used. Consuming is single-use and atomic: the first call wins and returns the evaluation with consumed set to true. A later call for the same evaluation fails with a 409, which lets you treat an evaluation as a one-time token and guard against replays.
Parameters
No parameters
Returns
Returns the consumed evaluation object.
POST/v3/evaluations/:id/consume
const evaluation = await rupt.consumeEvaluation(EVALUATION_ID);
Response
{
"id": "649873be6e8b6f9b33722a0c",
"action": "login",
"verdict": "allow",
"reasons": ["known_device"],
"user": {
"rupt_id": "649873be6e8b6f9b33722a0c",
"id": "external_account_id",
"email": "user@example.com",
"phone": "+15551234567"
},
"consumed": true,
"consumed_at": "2021-09-01T00:00:00.000Z",
"createdAt": "2021-09-01T00:00:00.000Z",
"updatedAt": "2021-09-01T00:00:00.000Z"
}