When sending a custom rule in a request body, you must specify the conditionType
, operator
, value
, and sometimes the fieldOption
. Depending on the conditionType
, there are certain allowed operator
values, and the data type of value
and fieldOption
may change. You must adhere to the specifications of these below, or your rule won't properly update.
The following allowed operator
values correspond to operators in the HUMAN platform.
Operator value Operator name Description $eq
is Checks if the value is equal to the specified value. $contains
contains Checks if the value contains the specified substring. $startsWith
starts with Checks if the value starts with the specified substring. $endsWith
ends with Checks if the value ends with the specified substring. $re
matches Checks if the value matches the specified regular expression. $notEndsWith
not ends with Checks if the value does not end with the specified substring. $ne
is not Checks if the value is not equal to the specified value. $in
in Checks if the value is in the specified list of values. $notIn
not in Checks if the value is not in the specified list of values. $exists
exists Checks if the field exists. $notExists
not exists Checks if the field does not exist.
The conditionType
dictates the field upon which the operator
should act. Each conditionType
has a certain set of supported operator
values with specific value
data types. Be sure to reference the relevant conditionType
for the available operator
values.
Supported operator value
typevalue
format$eq
String $contains
String $startsWith
String $endsWith
String $re
Array of strings Valid regex expression
JSON
{
"conditionType": "userAgent",
"operator": "$re",
"value": ["Mozilla.*", "Chrome.*"],
}
{
"conditionType": "userAgent",
"operator": "$startsWith",
"value": "Mozilla",
}
Supported operator value
typevalue
format$endsWith
String $notEndsWith
String $eq
String $ne
String $re
Array of strings Valid regex expression
JSON
{
"conditionType": "domain",
"operator": "$notEndsWith",
"value": ".com",
}
{
"conditionType": "domain",
"operator": "$eq",
"value": "test-site",
}
Supported operator value
typevalue
format$eq
String Valid IP address $ne
String Valid IP address $in
Array of strings Valid IP address $notIn
Array of strings Valid IP address
JSON
{
"conditionType": "socketIps",
"operator": "$in",
"value": [
"2001:db8:3333:4444:5555:6666:7777:8888",
"2001:db8:3333:4444:CCCC:DDDD:EEEE:FFFF",
"2.2.2.2",
"1.1.1.1",
"128.5.5.5/8",
"3.3.3.3/4",
],
}
{
"conditionType": "domain",
"operator": "$ne",
"value": "128.5.5.5/8",
}
Supported operator value
typevalue
format$eq
String AS $ne
String AS $in
Array of strings AS $notIn
Array of strings AS
JSON
{
"conditionType": "socketIpASN",
"operator": "$notIn",
"value": ["AS61", "AS21", "AS55"],
}
{
"conditionType": "socketIpASN",
"operator": "$ne",
"value": "AS61",
}
Supported operator value
typevalue
format$startsWith
String $endsWith
String $contains
String $eq
String $re
Array of strings Valid regex expression
JSON
{
"conditionType": "path",
"operator": "$startsWith",
"value": "/login",
}
{
"conditionType": "path",
"operator": "$re",
"value": ["\/login.*", "\/sign-.*"],
}
🚧 Warning
The queryParam
condition also requires the fieldOption
parameter, as described below.
Supported operator fieldOption
typevalue
typevalue
format$exists
String $notExists
String $in
String String $notIn
String String $re
Array of strings String Valid regex expression
JSON
{
"conditionType": "queryParam",
"fieldOption": "param1",
"operator": "$exists",
}
{
"conditionType": "queryParam",
"fieldOption": "param2",
"operator": "$re",
"value": ["value", "value2"],
}
🚧 Warning
The header
condition also requires the fieldOption
parameter, as described below.
Supported operator fieldOption
typevalue
typevalue
format$exists
String $notExists
String $in
String String $notIn
String String $re
Array of strings String Valid regex expression
JSON
{
"conditionType": "header",
"operator": "$exists",
"fieldOption": "header-1",
}
{
"conditionType": "header",
"fieldOption": "header-1.1",
"operator": "$notIn",
"value": ["value1", "value2"],
}
Supported operator value
typevalue
options$in
String "GET", "POST", "DELETE", "PATCH", "PUT", "HEAD", "OPTIONS", "CONNECT", "TRACE" $notIn
String "GET", "POST", "DELETE", "PATCH", "PUT", "HEAD", "OPTIONS", "CONNECT", "TRACE"
JSON
{
"conditionType": "httpMethod",
"operator": "$in",
"value": ["GET", "POST"],
}
Supported operator value
typevalue
options$eq
String "desktop", "mobile", "mobile_api", "other" $in
String "desktop", "mobile", "mobile_api", "other"
JSON
{
"conditionType": "deviceType",
"operator": "$eq",
"value": "desktop",
}
{
"conditionType": "deviceType",
"operator": "$in",
"value": ["desktop", "mobile_api"],
}
Supported operator value
typevalue
options$in
String Valid country code $notIn
String Valid country code
JSON
{
"conditionType": "country",
"operator": "$notIn",
"value": ["IR"],
}
{
"conditionType": "country",
"operator": "$in",
"value": ["US", "UK"],
}
🚧 Warning
The customParam
condition also requires the fieldOption
parameter, as described below.
Supported operator fieldOption
optionsvalue
typevalue
format$exists
"custom_param1", "custom_param2", "custom_param3", "custom_param4", "custom_param5", "custom_param6", "custom_param7", "custom_param8", "custom_param9", "custom_param10" $notExists
"custom_param1", "custom_param2", "custom_param3", "custom_param4", "custom_param5", "custom_param6", "custom_param7", "custom_param8", "custom_param9", "custom_param10" $eq
"custom_param1", "custom_param2", "custom_param3", "custom_param4", "custom_param5", "custom_param6", "custom_param7", "custom_param8", "custom_param9", "custom_param10" String $ne
"custom_param1", "custom_param2", "custom_param3", "custom_param4", "custom_param5", "custom_param6", "custom_param7", "custom_param8", "custom_param9", "custom_param10" String $in
"custom_param1", "custom_param2", "custom_param3", "custom_param4", "custom_param5", "custom_param6", "custom_param7", "custom_param8", "custom_param9", "custom_param10" Array of strings $notIn
"custom_param1", "custom_param2", "custom_param3", "custom_param4", "custom_param5", "custom_param6", "custom_param7", "custom_param8", "custom_param9", "custom_param10" Array of strings $re
"custom_param1", "custom_param2", "custom_param3", "custom_param4", "custom_param5", "custom_param6", "custom_param7", "custom_param8", "custom_param9", "custom_param10" Array of strings Valid regex expression
JSON
{
"conditionType": "customParam",
"fieldOption": "custom_param1",
"operator": "$re",
"value": ["^(?!user).*$","^(?!email).*$"],
}
{
"conditionType": "customParam",
"fieldOption": "custom_param5",
"operator": "$notExists",
}