Skip to main content
GET
List Rules
Retrieve the rules for your account: default rules from rule packs and custom rules. Custom rules come from policy imports or from Create Custom Rule. Each rule includes an active field. With no query parameters, the list includes every rule, active or not. To see only the rules that run when you validate content, pass status=active. To see only your own rules, pass source=custom. Together, ?status=active&source=custom returns only your active custom rules, which is usually what you want while developing custom rules. A rule you just created, deactivated or reactivated can take a few seconds to show its new state in this list. 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.

Query Parameters

string
default:"all"
Which rules to return by enforcement state.
  • all: every rule, active or not.
  • active: only the rules that run during validation.
For a custom rule from a policy import, active also requires the import to be activated, with the rule among its activated rules. Such a rule can show active: true in the unfiltered list and still be left out here, because it doesn’t run until its import is activated. See Activate Rules.
string
default:"all"
Which kind of rule to return.
  • all: default and custom rules.
  • custom: only your custom rules. default_rules is an empty array.
  • default: only default rules from rule packs. custom_rules is an empty array.
Values are case-sensitive and must be lowercase. If you include a parameter, it must have one of the values above: an empty value such as ?status= returns 400 instead of the full list. Filtering never changes the shape of the response. Both arrays are always present, and a list the filter excludes is empty. Every *_count field counts the rules in this response, not all rules on your account. With status=active, each *_count equals the matching *_active_count.

Response

string
Your customer identifier
array
Default rules from rule packs
array
Custom rules, both those extracted from policy imports and those created with Create Custom Rule
integer
Number of default rules in this response (active + deactivated)
integer
Number of active default rules in this response
integer
Number of custom rules in this response (active + deactivated)
integer
Number of active custom rules in this response
integer
Number of rules in this response, default and custom
integer
Number of active rules in this response, default and custom

Errors

Example

With ?status=active&source=custom, the response keeps the same fields. default_rules is empty, and the counts describe only the custom rules returned: