Skip to content

Create a bot challenge rule

POST
/api/v2/organizations/{organization}/projects/{project}/rules/bot-challenge
curl --request POST \
--url https://dashboard.quantcdn.io/api/v2/organizations/example/projects/example/rules/bot-challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "domain": [ "test-domain.com", "*.test-domain.com" ], "name": "Test redirect rule", "uuid": "123e4567-e89b-12d3-a456-426614174000", "weight": 0, "disabled": false, "url": [ "/old-path/*", "/legacy/*" ], "country": "country_is", "country_is": [ "US", "CA", "GB" ], "country_is_not": [ "CN", "RU" ], "method": "method_is", "method_is": [ "GET", "POST" ], "method_is_not": [ "DELETE", "PUT" ], "ip": "ip_is", "ip_is": [ "192.168.1.0/24", "10.0.0.1" ], "ip_is_not": [ "172.16.0.0/12" ], "asn": "any", "asn_is": [ "15169", "8075" ], "asn_is_not": [ "13335" ], "robot_challenge_type": "invisible", "robot_challenge_verification_ttl": 10800, "robot_challenge_challenge_ttl": 30 }'
organization
required
string

Organization identifier

project
required
string

Project identifier

Media typeapplication/json
object
domain
required

Domain patterns (default: any)

Array<string>
Example
[
"test-domain.com",
"*.test-domain.com"
]
name

Rule name

string
Example
Test redirect rule
uuid

Rule UUID

string
Example
123e4567-e89b-12d3-a456-426614174000
weight

Rule weight

integer
0
Example
100
disabled

Whether rule is disabled

boolean
Example
false
url
required

URL patterns

Array<string>
Example
[
"/old-path/*",
"/legacy/*"
]
country

Country filter type (country_is, country_is_not, any)

string
Example
country_is
country_is

Allowed countries

Array<string>
Example
[
"US",
"CA",
"GB"
]
country_is_not

Excluded countries

Array<string>
Example
[
"CN",
"RU"
]
method

Method filter type (method_is, method_is_not, any)

string
Example
method_is
method_is

Allowed HTTP methods

Array<string>
Example
[
"GET",
"POST"
]
method_is_not

Excluded HTTP methods

Array<string>
Example
[
"DELETE",
"PUT"
]
ip

IP filter type (ip_is, ip_is_not, any)

string
Example
ip_is
ip_is

Allowed IP addresses

Array<string>
Example
[
"192.168.1.0/24",
"10.0.0.1"
]
ip_is_not

Excluded IP addresses

Array<string>
Example
[
"172.16.0.0/12"
]
asn

ASN filter type (asn_is, asn_is_not, any)

string
Example
any
asn_is

Allowed AS numbers

Array<string>
Example
[
"15169",
"8075"
]
asn_is_not

Excluded AS numbers

Array<string>
Example
[
"13335"
]
robot_challenge_type
required

Challenge type (invisible or checkbox)

string
Example
invisible
robot_challenge_verification_ttl

Verification TTL in seconds

integer
default: 10800
Example
10800
robot_challenge_challenge_ttl

Challenge TTL in seconds

integer
default: 30
Example
30

The request has succeeded.

Media typeapplication/json
object
name

Rule name

string
uuid
required

Rule UUID

string
rule_id

Rule ID

string
weight

Rule weight

integer
0
url

URL patterns

Array<string>
domain

Domain patterns

Array<string>
disabled
required

Whether rule is disabled

boolean
only_with_cookie

Only apply with cookie

string
method

HTTP method

string
method_is

Allowed HTTP methods

Array<string>
method_is_not

Excluded HTTP methods

Array<string>
ip

IP address

string
ip_is

Allowed IP addresses

Array<string>
ip_is_not

Excluded IP addresses

Array<string>
asn

ASN filter type (asn_is, asn_is_not, any)

string
asn_is

Allowed AS numbers

Array<string>
asn_is_not

Excluded AS numbers

Array<string>
country

Country code

string
country_is

Allowed countries

Array<string>
country_is_not

Excluded countries

Array<string>
action
required

Rule action

string
action_config
required
object
robot_challenge_type
required

Challenge type (invisible or checkbox)

string
robot_challenge_verification_ttl

Verification TTL in seconds

integer
default: 10800
robot_challenge_challenge_ttl

Challenge TTL in seconds

integer
default: 30
Example
{
"name": "Test redirect rule",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"rule_id": "rule-001",
"weight": 0,
"url": [
"/old-path/*",
"/legacy/*"
],
"domain": [
"test-domain.com",
"*.test-domain.com"
],
"disabled": false,
"only_with_cookie": "session_id",
"method": "GET",
"method_is": [
"GET",
"POST"
],
"method_is_not": [
"DELETE",
"PUT"
],
"ip": "192.168.1.1",
"ip_is": [
"192.168.1.0/24",
"10.0.0.1"
],
"ip_is_not": [
"172.16.0.0/12"
],
"asn": "any",
"asn_is": [
"15169",
"8075"
],
"asn_is_not": [
"13335"
],
"country": "US",
"country_is": [
"US",
"CA",
"GB"
],
"country_is_not": [
"CN",
"RU"
],
"action": "redirect",
"action_config": {
"robot_challenge_type": "invisible",
"robot_challenge_verification_ttl": 10800,
"robot_challenge_challenge_ttl": 30
}
}

The server could not understand the request due to invalid syntax.

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
Example
{
"message": "The requested resource was not found",
"error": true
}

Access is forbidden.

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

boolean
Example
{
"message": "The requested resource was not found",
"error": true
}