Set Rule
Set a rule for a particular visitor_id, browser_id, visitor_fingerprint, browser_fingerprint, hardware_fingerprint, network_fingerprint, cidr_block, asn, or country_code. This is helpful in cases where you want to allow or block a specific user or fingerprint. You should be careful when setting rules for browser_fingerprint, hardware_fingerprint, or network_fingerprint as they can be shared across multiple users, and you could affect more users than intended.
You may not set an ALLOW rule for a country_code.
Rules are applied in the order specified above. For example, if an end user has an ALLOW rule set for their visitor_id but a BLOCK rule set for their hardware_fingerprint, they will receive an ALLOW verdict because the visitor_id rule takes precedence.
If there are conflicts between multiple cidr_block rules (for example, if the ip_address of the end user overlaps with multiple CIDR blocks that have rules set), the conflicts are resolved as follows:
- The smallest block size takes precedence. For example, if an
ip_addressoverlaps with acidr_blockrule ofALLOWfor a block with a prefix of/32and acidr_blockrule ofBLOCKwith a prefix of/24, the rule match verdict will beALLOW. - Among equivalent size blocks,
BLOCKtakes precedence overCHALLENGE, which takes precedence overALLOW. For example, if anip_addressoverlaps with twocidr_blockrules with blocks of the same size that returnCHALLENGEandALLOW, the rule match verdict will beCHALLENGE.
Authorizations
Body
Request type
The action that should be returned by a fingerprint lookup for that identifier with a RULE_MATCH reason. The following values are valid: ALLOW, BLOCK, CHALLENGE, or NONE. For country codes, ALLOW actions are not allowed. If a NONE action is specified, it will clear the stored rule.
ALLOW, CHALLENGE, BLOCK, NONE The CIDR block we want to set a rule for. You may pass either an IP address or a CIDR block. The CIDR block prefix must be between 16 and 32, inclusive. If an end user's IP address is within this CIDR block, this rule will be applied. Only one identifier can be specified in the request.
Response
Successful response