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.

Operator definitions

The following allowed operator values correspond to operators in the HUMAN platform.

Operator valueOperator nameDescription
$eqisChecks if the value is equal to the specified value.
$containscontainsChecks if the value contains the specified substring.
$startsWithstarts withChecks if the value starts with the specified substring.
$endsWithends withChecks if the value ends with the specified substring.
$rematchesChecks if the value matches the specified regular expression.
$notEndsWithnot ends withChecks if the value does not end with the specified substring.
$neis notChecks if the value is not equal to the specified value.
$ininChecks if the value is in the specified list of values.
$notInnot inChecks if the value is not in the specified list of values.
$existsexistsChecks if the field exists.
$notExistsnot existsChecks if the field does not exist.

Supported operators by condition type

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.

User agent (userAgent)

Supported operatorvalue typevalue format
$eqString
$containsString
$startsWithString
$endsWithString
$reArray of stringsValid regex expression

Examples

{   
    "conditionType": "userAgent",
    "operator": "$re",
    "value": ["Mozilla.*", "Chrome.*"],
}

{
    "conditionType": "userAgent",
    "operator": "$startsWith",
    "value": "Mozilla",
}

Domain (domain)

Supported operatorvalue typevalue format
$endsWithString
$notEndsWithString
$eqString
$neString
$reArray of stringsValid regex expression

Examples

{
    "conditionType": "domain",
    "operator": "$notEndsWith",
    "value": ".com",
}

{
    "conditionType": "domain",
    "operator": "$eq",
    "value": "test-site",
}

IP address (socketIps)

Supported operatorvalue typevalue format
$eqStringValid IP address
$neStringValid IP address
$inArray of stringsValid IP address
$notInArray of stringsValid IP address

Examples

{
    "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",
}

ASN (socketIpASN)

Supported operatorvalue typevalue format
$eqStringAS
$neStringAS
$inArray of stringsAS
$notInArray of stringsAS

Examples

{   
    "conditionType": "socketIpASN",
    "operator": "$notIn",
    "value": ["AS61", "AS21", "AS55"],
}

{   
    "conditionType": "socketIpASN",
    "operator": "$ne",
    "value": "AS61",
}

Path (path)

Supported operatorvalue typevalue format
$startsWithString
$endsWithString
$containsString
$eqString
$reArray of stringsValid regex expression

Examples

{
    "conditionType": "path",
    "operator": "$startsWith",
    "value": "/login",
}

{ 
    "conditionType": "path",
    "operator": "$re",
    "value": ["\/login.*", "\/sign-.*"],
}

Query parameter (queryParam)

🚧

Warning

The queryParam condition also requires the fieldOption parameter, as described below.

Supported operatorfieldOption typevalue typevalue format
$existsString
$notExistsString
$inStringString
$notInStringString
$reArray of stringsStringValid regex expression

Examples

{   
    "conditionType": "queryParam",
    "fieldOption": "param1",
    "operator": "$exists",
}

{   
    "conditionType": "queryParam",
    "fieldOption": "param2",
    "operator": "$re",
    "value": ["value", "value2"],
}

Header (header)

🚧

Warning

The header condition also requires the fieldOption parameter, as described below.

Supported operatorfieldOption typevalue typevalue format
$existsString
$notExistsString
$inStringString
$notInStringString
$reArray of stringsStringValid regex expression

Examples

{   
    "conditionType": "header",
    "operator": "$exists",
    "fieldOption": "header-1",
}

{   
    "conditionType": "header",
    "fieldOption": "header-1.1",
    "operator": "$notIn",
    "value": ["value1", "value2"],
}

HTTP method (httpMethod)

Supported operatorvalue typevalue options
$inString"GET", "POST", "DELETE", "PATCH", "PUT", "HEAD", "OPTIONS", "CONNECT", "TRACE"
$notInString"GET", "POST", "DELETE", "PATCH", "PUT", "HEAD", "OPTIONS", "CONNECT", "TRACE"

Examples

{ 
    "conditionType": "httpMethod",
    "operator": "$in",
    "value": ["GET", "POST"],
}

Device type (deviceType)

Supported operatorvalue typevalue options
$eqString"desktop", "mobile", "mobile_api", "other"
$inString"desktop", "mobile", "mobile_api", "other"

Examples

{   
    "conditionType": "deviceType",
    "operator": "$eq",
    "value": "desktop",
}

{
    "conditionType": "deviceType",
    "operator": "$in",
    "value": ["desktop", "mobile_api"],
}

Country (country)

Supported operatorvalue typevalue options
$inStringValid country code
$notInStringValid country code

Examples

{
    "conditionType": "country",
    "operator": "$notIn",
    "value": ["IR"],
}

{   
    "conditionType": "country",
    "operator": "$in",
    "value": ["US", "UK"],
}

Custom parameter (customParam)

🚧

Warning

The customParam condition also requires the fieldOption parameter, as described below.

Supported operatorfieldOption 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 stringsValid regex expression

Examples

{
    "conditionType": "customParam",
    "fieldOption": "custom_param1",
    "operator": "$re",
    "value": ["^(?!user).*$","^(?!email).*$"],
}

{
    "conditionType": "customParam",
    "fieldOption": "custom_param5",
    "operator": "$notExists",
}