Skip to main content
POST
/
v1
/
risk
/
events
Normalize risk event
curl --request POST \
  --url https://api.truthlocks.com/v1/risk/events \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "event_type": "<string>",
  "subject_id": "<string>",
  "data": {},
  "timestamp": "<string>"
}
'
import requests

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

payload = {
"event_type": "<string>",
"subject_id": "<string>",
"data": {},
"timestamp": "<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({
event_type: '<string>',
subject_id: '<string>',
data: {},
timestamp: '<string>'
})
};

fetch('https://api.truthlocks.com/v1/risk/events', 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/events",
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([
'event_type' => '<string>',
'subject_id' => '<string>',
'data' => [

],
'timestamp' => '<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/events"

payload := strings.NewReader("{\n \"event_type\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"data\": {},\n \"timestamp\": \"<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/events")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event_type\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"data\": {},\n \"timestamp\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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 \"event_type\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"data\": {},\n \"timestamp\": \"<string>\"\n}"

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

How Normalization Works

When you submit an identity event, the platform:
  1. Records the raw event in the audit trail
  2. Maps the event_type to a canonical signal type and base risk score
  3. Enriches the signal with available metadata (issuer trust tier, geo, device)
  4. Stores a risk_signal record ready for policy evaluation

Built-in Event Mappings

Event TypeSignal TypeBase Score
verification.failedbehavior60
verification.invalid_sigbehavior75
login.failed.repeatedato70
login.suspicious_geogeo_anomaly65
attestation.deepfake_suspectdeepfake85
session.hijack_suspectato90
Unknown event types are accepted with a base score of 10 and signal type behavior.

Request

event_source
string
required
The system that generated this event: attestation, verification, login, consumer_portal
event_type
string
required
The raw event name (e.g. login.failed, verification.failed, attestation.deepfake_suspect)
subject_id
string
required
Identifier of the entity involved in the event.
event_ref_id
string
External reference ID (attestation_id, session_id, etc.) for cross-referencing.
ip_address
string
Source IP address.
payload
object
Raw event payload for enrichment context.

Response

event_id
string
UUID of the recorded raw event source.
signal_id
string
UUID of the normalized risk signal created from this event.
signal_type
string
The normalized signal type derived from the event.
risk_score
integer
The base risk score assigned during normalization.
normalized
boolean
true if the event matched a known mapping; false if it used the generic fallback.

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Body

application/json
event_type
string
required
subject_id
string
required
data
object
timestamp
string

Response

Event ingested

event_id
string
signal_id
string