List Rules
curl --request GET \
--url https://api.zerodrift.ai/api/policies/rules \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zerodrift.ai/api/policies/rules"
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.zerodrift.ai/api/policies/rules', 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.zerodrift.ai/api/policies/rules",
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.zerodrift.ai/api/policies/rules"
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.zerodrift.ai/api/policies/rules")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zerodrift.ai/api/policies/rules")
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{
"customer_id": "abc-123",
"default_rules": [
{
"rule_id": "signal_mnpi_leak",
"type": "AI_SIGNAL",
"source": "default",
"active": true,
"rule_pack_id": "sec_finra_comms_v2",
"rule_pack_scenario_ids": [],
"threshold": 0.60,
"operator": ">="
}
],
"custom_rules": [
{
"rule_id": "cust_abc123_require_risk_disclosure",
"type": "AI_SIGNAL",
"name": "Risk Disclosure Required",
"severity": "do_not_send",
"source": "custom",
"active": true,
"import_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"default_rules_count": 119,
"default_rules_active_count": 115,
"custom_rules_count": 5,
"custom_rules_active_count": 5,
"total_rules_count": 124,
"total_active_count": 120
}
Policy
List Rules
List all default and custom rules with their active/deactivated status
GET
/
api
/
policies
/
rules
List Rules
curl --request GET \
--url https://api.zerodrift.ai/api/policies/rules \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zerodrift.ai/api/policies/rules"
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.zerodrift.ai/api/policies/rules', 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.zerodrift.ai/api/policies/rules",
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.zerodrift.ai/api/policies/rules"
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.zerodrift.ai/api/policies/rules")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zerodrift.ai/api/policies/rules")
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{
"customer_id": "abc-123",
"default_rules": [
{
"rule_id": "signal_mnpi_leak",
"type": "AI_SIGNAL",
"source": "default",
"active": true,
"rule_pack_id": "sec_finra_comms_v2",
"rule_pack_scenario_ids": [],
"threshold": 0.60,
"operator": ">="
}
],
"custom_rules": [
{
"rule_id": "cust_abc123_require_risk_disclosure",
"type": "AI_SIGNAL",
"name": "Risk Disclosure Required",
"severity": "do_not_send",
"source": "custom",
"active": true,
"import_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"default_rules_count": 119,
"default_rules_active_count": 115,
"custom_rules_count": 5,
"custom_rules_active_count": 5,
"total_rules_count": 124,
"total_active_count": 120
}
Retrieve all rules for your account, including default rules from rule packs and custom rules from policy imports. Each rule includes an
active field indicating whether it will run during validation.
Use rule_id from this response in validation_scope.rules on
Enforce Content. Custom IDs are
prefixed cust_. For rulepack IDs, use id from
Rule Packs, not rule_pack_id on this list.
Untrained custom rules run on anchor_3_0_max.
Response
string
Your customer identifier
array
Default rules from rule packs
Show default rule properties
Show default rule properties
string
Rule identifier (e.g.,
signal_mnpi_leak)string
AI_SIGNAL or REGEXstring
Always
default for built-in rulesboolean
Whether this rule is currently active for your account
boolean
Whether this rule can run in simulation. Non-simulatable rules are still
listed so clients can render them disabled.
string
Rule pack this rule belongs to (e.g.,
sec_finra_comms_v2)array
Rule-pack grouping identifiers for this rule
number
Confidence threshold for AI signals
string
Threshold comparison operator (e.g.,
>=)array
Custom rules from policy imports
Show custom rule properties
Show custom rule properties
string
Rule identifier (prefixed with
cust_)string
AI_SIGNAL, REGEX, or REQUIRE_NEARstring
Human-readable rule name
string
Always
custom for customer-owned rulesboolean
Whether this rule is currently active
boolean
Whether this rule can run in simulation
string
Import ID this rule was extracted from (when created via policy import)
string
do_not_send or send_with_cautionstring
fix or flagstring
Text window for evaluation
string
ISO 8601 creation timestamp
integer
Total number of default rules (active + deactivated)
integer
Number of active default rules
integer
Total number of custom rules (active + deactivated)
integer
Number of active custom rules
integer
Total rules across default + custom
integer
Total active rules across default + custom
{
"customer_id": "abc-123",
"default_rules": [
{
"rule_id": "signal_mnpi_leak",
"type": "AI_SIGNAL",
"source": "default",
"active": true,
"rule_pack_id": "sec_finra_comms_v2",
"rule_pack_scenario_ids": [],
"threshold": 0.60,
"operator": ">="
}
],
"custom_rules": [
{
"rule_id": "cust_abc123_require_risk_disclosure",
"type": "AI_SIGNAL",
"name": "Risk Disclosure Required",
"severity": "do_not_send",
"source": "custom",
"active": true,
"import_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"default_rules_count": 119,
"default_rules_active_count": 115,
"custom_rules_count": 5,
"custom_rules_active_count": 5,
"total_rules_count": 124,
"total_active_count": 120
}

