Compliance Request
Use this endpoint to run TruRisk AI analysis on an existing search case — without creating a new case via /api/search.
When to use this endpoint
Call POST /api/compliance-request when:
- You already created a case with
/api/searchandrun_tru_riskwasfalse(or omitted). - You later decide to run TruRisk on that same case.
- You want to avoid submitting a duplicate search — instead, pass the existing
search_reference.
This endpoint is also the standard way to escalate a case: screen at TruRisk Lite by default for speed, and when a case comes back as Potential Match or Uncertain and warrants deeper review, call this endpoint with tru_risk_mode set to TruRisk Advanced to re-run the same case with full identity and relationship analysis—without creating a duplicate search.
Make Case (/api/search with run_tru_risk: false) → review results → Compliance Request (/api/compliance-request) to attach TruRisk to the same case.
Mode behavior
The TruRisk mode used for this request defaults to your organization's configured default_mode (Configuration). You can override it with tru_risk_mode.
| Override | Result |
|---|---|
| Advanced → Lite | Always allowed. Uses data already stored on the original search. |
| Lite → Advanced | Allowed only if the required Advanced fields are available from the original search (e.g. DOB) or from your organization's TruRisk Configuration (advanced_fields). If neither source has the needed fields, the API returns a 400 error. |
This endpoint does not accept Advanced identity fields in the request body. Required data must already exist on the search case or in Configuration — you cannot supply them here at compliance-request time.
Create Compliance Request
Endpoint: https://api.amlwatcher.com/api/compliance-request
Method: POST
- HTTP
- Javascript
- PHP
- Python
- Ruby
- Java
- cURL
- C#
- Go
POST /api/compliance-request HTTP/1.1
Host: api.amlwatcher.com
Content-Type: application/json
Authorization: Bearer Token
{
"search_reference": "Your Search Reference"
}
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer Token");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
search_reference: "Your Search Reference",
});
var requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow",
};
fetch("https://api.amlwatcher.com/api/compliance-request", requestOptions)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.amlwatcher.com/api/compliance-request',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"search_reference": "Your Search Reference"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer Token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://api.amlwatcher.com/api/compliance-request"
payload = json.dumps({
"search_reference": "Your Search Reference"
})
headers = {
'Authorization': 'Bearer Token',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://api.amlwatcher.com/api/compliance-request")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer Token"
request.body = JSON.dump({
"search_reference" => "Your Search Reference"
})
response = https.request(request)
puts response.read_body
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.amlwatcher.com/api/compliance-request");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Authorization", "Bearer Token");
conn.setDoOutput(true);
String jsonInputString = "{\"search_reference\": \"Your Search Reference\"}";
try (OutputStream os = conn.getOutputStream()) {
byte[] input = jsonInputString.getBytes("utf-8");
os.write(input, 0, input.length);
}
System.out.println(conn.getResponseCode());
}
}
curl --location --request POST 'https://api.amlwatcher.com/api/compliance-request' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer Token' \
--data-raw '{
"search_reference": "Your Search Reference"
}'
using RestSharp;
using System;
var client = new RestClient("https://api.amlwatcher.com/api/compliance-request");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer Token");
request.AddJsonBody(new {
search_reference = "Your Search Reference"
});
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
url := "https://api.amlwatcher.com/api/compliance-request"
payload := strings.NewReader(`{
"search_reference": "Your Search Reference"
}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer Token")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
search_reference | String | Yes | The 24-character reference returned by /api/search for the case you want to analyze with TruRisk. |
tru_risk_mode | Enum | No | Override the organization default. Must be TruRisk Lite or TruRisk Advanced. If omitted, uses default_mode from TruRisk Configuration. |
tru_risk_mode to Advanced- Advanced → Lite: Safe. No extra fields needed.
- Lite → Advanced: The original search must already include required fields (such as
birth_incorporation_date), or those fields must be enabled/available via TruRisk Configuration (advanced_fields). This payload does not support passing Advanced fields (e.g. DOB, nationality, identifiers). If neither the search nor Configuration provides them, the request fails with a400error.
Success Response
{
"data": {
"message": "TruRisk request created",
"search_reference": "Your Search Reference"
},
"error": false,
"status": "SUCCESS"
}
| Parameter | Type | Description |
|---|---|---|
status | String | Indicates the result of the request (e.g., SUCCESS). |
error | Boolean | false when the request was accepted successfully. |
data.message | String | Confirmation that the TruRisk request was created. |
data.search_reference | String | Echo of the search reference now queued for TruRisk. |
Error Responses
| Code | Message / Condition | When it occurs |
|---|---|---|
400 | TruRisk is not enabled for this organization | Org does not have TruRisk Lite or Advanced purchased. |
400 | TruRisk is not enabled in your configuration. Please enable it in settings. | Master switch (enabled) is off in Configuration. |
400 | Please provide search_reference | search_reference is missing. |
400 | Invalid search_reference format | Value is not a 24-character string. |
400 | No search found for: {search_reference} | Case does not exist for this organization. |
400 | A compliance request already exists for search_reference: {search_reference} | TruRisk was already requested for this case. |
400 | Not enough data is available to perform a TruRisk Advanced search. Please create a new search with the required fields, or select TruRisk Lite mode. | Lite → Advanced (or Advanced by default), and required fields are missing from both the original search and Configuration. |
400 | TruRisk Advanced mode is not available for this organization. / TruRisk Lite mode is not available for this organization. | Requested mode is not purchased for the org. |
400 | TruRisk check not required for 'No Match' results | Search has no potential matches to analyze. |
403 | Insufficient TruRisk Lite credits. / Insufficient TruRisk Advanced credits. | Mode-specific credit limit reached. |
401 | Unauthorized | Missing or invalid Bearer Token. |
Recommended integration pattern
1. POST /api/search
{ "name": "...", "run_tru_risk": false, "birth_incorporation_date": "10-03-1947", ... }
→ receive search_reference
2. Later, when TruRisk is needed:
POST /api/compliance-request
{ "search_reference": "<from step 1>" }
→ uses organization default_mode
3. Mode overrides:
Advanced → Lite:
{ "search_reference": "...", "tru_risk_mode": "TruRisk Lite" } → OK
Lite → Advanced:
OK only if required fields already exist on the original search
OR are available via TruRisk Configuration (advanced_fields).
Otherwise → 400 error. Do not send Advanced fields in this payload.