Skip to main content
POST
/
v1
/
risk
/
evaluate
Risk evaluate
curl --request POST \
  --url https://api.truthlocks.com/v1/risk/evaluate \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "subject_id": "<string>",
  "risk_score": 50,
  "subject_type": "user",
  "mint_receipt": true,
  "issuer_id": "<string>",
  "kid": "<string>"
}
'
import requests

url = "https://api.truthlocks.com/v1/risk/evaluate"

payload = {
"subject_id": "<string>",
"risk_score": 50,
"subject_type": "user",
"mint_receipt": True,
"issuer_id": "<string>",
"kid": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject_id: '<string>',
risk_score: 50,
subject_type: 'user',
mint_receipt: true,
issuer_id: '<string>',
kid: '<string>'
})
};

fetch('https://api.truthlocks.com/v1/risk/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.truthlocks.com/v1/risk/evaluate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject_id' => '<string>',
'risk_score' => 50,
'subject_type' => 'user',
'mint_receipt' => true,
'issuer_id' => '<string>',
'kid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.truthlocks.com/v1/risk/evaluate"

payload := strings.NewReader("{\n \"subject_id\": \"<string>\",\n \"risk_score\": 50,\n \"subject_type\": \"user\",\n \"mint_receipt\": true,\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.truthlocks.com/v1/risk/evaluate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subject_id\": \"<string>\",\n \"risk_score\": 50,\n \"subject_type\": \"user\",\n \"mint_receipt\": true,\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.truthlocks.com/v1/risk/evaluate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject_id\": \"<string>\",\n \"risk_score\": 50,\n \"subject_type\": \"user\",\n \"mint_receipt\": true,\n \"issuer_id\": \"<string>\",\n \"kid\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "decision_id": "<string>",
  "signal_id": "<string>",
  "policy_id": "<string>",
  "receipt_id": "<string>"
}
{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}

How Evaluation Works

  1. The signal is ingested into risk_signals
  2. Your active policy rules are evaluated (highest priority match wins)
  3. A risk_decision record is created with the outcome
  4. If mint_receipt: true and issuer_id/kid are provided, a fraud_decision_receipt is minted via the attestation service

Decision Outcomes

ActionMeaning
allowNo policy matched or score below all thresholds
challengeMFA or step-up authentication required
blockReject the action entirely
reviewRoute to manual fraud review queue

Built-in receipt types

Receipt TypePurpose
fraud_decision_receiptRecords allow/challenge/block/review decision
ato_alert_receiptRecords ATO alert events
risk_block_receiptProves an action was blocked
deepfake_detection_receiptRecords deepfake scan results

Request

signal_type
string
required
Signal type: velocity, ato, deepfake, impersonation, geo_anomaly, behavior, device_fingerprint
subject_id
string
required
Subject identifier.
risk_score
integer
required
Risk score (0–100).
subject_type
string
Defaults to user.
mint_receipt
boolean
If true, mints a fraud_decision_receipt after evaluation. Requires issuer_id and kid.
issuer_id
string
Issuer UUID for receipt minting.
kid
string
Key ID for receipt signing.

Response

decision
string
allow | challenge | block | review
decision_id
string
UUID of the risk decision record.
signal_id
string
UUID of the ingested risk signal.
policy_id
string
UUID of the matching policy rule (if any).
receipt_id
string
UUID of the minted receipt (only if mint_receipt: true and succeeded).

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Body

application/json
signal_type
enum<string>
required
Available options:
velocity,
ato,
deepfake,
impersonation,
geo_anomaly,
behavior,
device_fingerprint
subject_id
string
required
risk_score
integer
required
Required range: 0 <= x <= 100
subject_type
string
default:user
mint_receipt
boolean
issuer_id
string
kid
string

Response

Risk decision

decision_id
string
signal_id
string
decision
enum<string>
Available options:
allow,
challenge,
block,
review
policy_id
string | null
receipt_id
string | null