Skip to main content
GET
/
v1
/
risk
/
velocity
/
{subject_id}
Get velocity windows
curl --request GET \
  --url https://api.truthlocks.com/v1/risk/velocity/{subject_id} \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://api.truthlocks.com/v1/risk/velocity/{subject_id}"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://api.truthlocks.com/v1/risk/velocity/{subject_id}', 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/velocity/{subject_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)

func main() {

url := "https://api.truthlocks.com/v1/risk/velocity/{subject_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-Key", "<api-key>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.truthlocks.com/v1/risk/velocity/{subject_id}")
.header("X-API-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.truthlocks.com/v1/risk/velocity/{subject_id}")

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

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "subject_id": "<string>",
  "windows": [
    {
      "window": "<string>",
      "count": 123,
      "action": "<string>"
    }
  ]
}
{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}
Returns the current velocity windows for a subject across all tracked action types. Each action type includes counts for the four rolling windows (1 m, 5 m, 1 h, 24 h) and the computed velocity score. Use this endpoint to check a subject’s current velocity profile without recording a new action. See the velocity and anomaly scoring guide for the scoring model and integration patterns.

Request

subject_id
string
required
Identifier of the subject to query.

Response

subject_id
string
The subject that was queried.
actions
array
List of tracked action types for this subject. Each entry includes action_type, windows (with 1m, 5m, 1h, 24h counts), and velocity_score.

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Path Parameters

subject_id
string
required

Subject identifier

Query Parameters

action
string

Filter by action type

Response

Velocity windows

subject_id
string
windows
object[]