Record velocity event
curl --request POST \
--url https://api.truthlocks.com/v1/risk/velocity/record \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"action_type": "<string>",
"subject_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({action_type: '<string>', subject_id: '<string>'})
};
fetch('https://api.truthlocks.com/v1/risk/velocity/record', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/risk/velocity/record"
payload = {
"action_type": "<string>",
"subject_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/risk/velocity/record"
payload := strings.NewReader("{\n \"action_type\": \"<string>\",\n \"subject_id\": \"<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))
}{
"event_id": "<string>",
"current_count": 123,
"window": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Velocity Scoring
Record velocity action
Record a subject action and evaluate it against velocity-based anomaly scoring. Auto-ingests a risk signal when the velocity score reaches 60 or above.
POST
/
v1
/
risk
/
velocity
/
record
Record velocity event
curl --request POST \
--url https://api.truthlocks.com/v1/risk/velocity/record \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"action_type": "<string>",
"subject_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({action_type: '<string>', subject_id: '<string>'})
};
fetch('https://api.truthlocks.com/v1/risk/velocity/record', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/risk/velocity/record"
payload = {
"action_type": "<string>",
"subject_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/risk/velocity/record"
payload := strings.NewReader("{\n \"action_type\": \"<string>\",\n \"subject_id\": \"<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))
}{
"event_id": "<string>",
"current_count": 123,
"window": "<string>"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Records an action for a subject and updates rolling window counters across four time windows (1 m, 5 m, 1 h, 24 h). A weighted velocity score is computed from the updated counts. When the score reaches 60 or above, a risk signal with
signal_type: "velocity" is automatically ingested into the risk signal pipeline.
See the velocity and anomaly scoring guide for the full workflow, scoring model, and integration patterns.
Scoring weights
| Window | Weight | Purpose |
|---|---|---|
| 1 minute | 30 | Burst detection |
| 5 minutes | 20 | Sustained short-term abuse |
| 1 hour | 10 | Medium-term patterns |
| 24 hours | 5 | Persistent anomalies |

