Skip to content

Update a custom error page rule

PATCH
/api/v2/organizations/{organization}/projects/{project}/rules/error-page/{rule}
curl --request PATCH \
--url https://dashboard.quantcdn.io/api/v2/organizations/example/projects/example/rules/error-page/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "domain": [ "test-domain.com", "www.test-domain.com" ], "name": "Test redirect rule", "uuid": "123e4567-e89b-12d3-a456-426614174000", "weight": 100, "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" ], "asn_is_not": [ "13335" ], "ua": "any", "ua_is": [ "Googlebot" ], "ua_is_not": [ "curl" ], "traffic_source": "any", "traffic_source_is": [ "tor-exit" ], "traffic_source_is_not": [ "crawler" ], "cookie_name": "session_id", "error_page_path": "/fr/_quant404", "status_codes": [ "404" ] }'
organization
required
string

Organization identifier

project
required
string

Project identifier

rule
required
string

Rule identifier

Media typeapplication/json
object
domain
required

Exact hostnames the rule matches, or ‘any’ (the default). Wildcards such as *.example.com are not supported.

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

Rule name

string
Example
Test redirect rule
uuid

Rule UUID

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

Rule order. Must be 0 or greater; lower weights are processed first. If omitted on create, the rule is placed last. A reorder in the Quant dashboard changes this rule’s weight; if weight is set in configuration, the next plan shows the difference and apply restores the configured order.

integer
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). A PATCH that omits it keeps the current value. Invalid values return 422.

string
Allowed values: any asn_is asn_is_not
Example
asn_is
asn_is

Allowed AS numbers. Positive integers up to 4294967295, stored as strings. A PATCH replaces the list.

Array<string>
Example
[
"15169"
]
asn_is_not

Excluded AS numbers. Positive integers up to 4294967295, stored as strings. A PATCH replaces the list.

Array<string>
Example
[
"13335"
]
ua

User agent filter type (ua_is, ua_is_not, any). Invalid values return 422.

string
Allowed values: any ua_is ua_is_not
Example
ua_is
ua_is

User agent strings to match. Each item has at most 255 characters. A PATCH replaces the list.

Array<string>
Example
[
"Googlebot"
]
ua_is_not

User agent strings to exclude. Each item has at most 255 characters. A PATCH replaces the list.

Array<string>
Example
[
"curl"
]
traffic_source

Traffic source filter type (traffic_source_is, traffic_source_is_not, any). Invalid values return 422.

string
Allowed values: any traffic_source_is traffic_source_is_not
Example
traffic_source_is
traffic_source_is

Traffic sources to match. A PATCH replaces the list.

Array<string>
Allowed values: cloud vpn tor-exit abuser crawler
Example
[
"tor-exit"
]
traffic_source_is_not

Traffic sources to exclude. A PATCH replaces the list.

Array<string>
Allowed values: cloud vpn tor-exit abuser crawler
Example
[
"crawler"
]
cookie_name

Write name of only_with_cookie: the rule applies only when this cookie is present. Empty string clears it.

string
Example
session_id
error_page_path
required

Published path of the page to serve as the error page

string
Example
/fr/_quant404
status_codes
required

Status codes this page is served for

Array<string>
Example
[
"404"
]

The request has succeeded.

Media typeapplication/json
object
name

Rule name

string
uuid
required

Rule UUID

string
rule_id

Rule ID

string
weight

Rule order. Must be 0 or greater; lower weights are processed first. If omitted on create, the rule is placed last. A reorder in the Quant dashboard changes this rule’s weight; if weight is set in configuration, the next plan shows the difference and apply restores the configured order.

integer
url

URL patterns

Array<string>
domain

Exact hostnames the rule matches, or ‘any’. Wildcards are not supported.

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 condition type (asn_is, asn_is_not, any)

string
asn_is

Allowed AS numbers

Array<string>
asn_is_not

Excluded AS numbers

Array<string>
ua

User agent condition type (ua_is, ua_is_not, any)

string
ua_is

User agent strings to match

Array<string>
ua_is_not

User agent strings to exclude

Array<string>
traffic_source

Traffic source condition type (traffic_source_is, traffic_source_is_not, any)

string
traffic_source_is

Traffic sources to match (cloud, vpn, tor-exit, abuser, crawler)

Array<string>
traffic_source_is_not

Traffic sources to exclude (cloud, vpn, tor-exit, abuser, crawler)

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
error_page_path
required

Published path of the page to serve as the error page

string
status_codes
required

Status codes this page is served for

Array<string>
Example
{
"name": "Test redirect rule",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"rule_id": "rule-001",
"weight": 100,
"url": [
"/old-path/*",
"/legacy/*"
],
"domain": [
"test-domain.com",
"www.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"
],
"ua": "any",
"ua_is": [
"Googlebot"
],
"ua_is_not": [
"curl"
],
"traffic_source": "any",
"traffic_source_is": [
"tor-exit"
],
"traffic_source_is_not": [
"crawler"
],
"country": "US",
"country_is": [
"US",
"CA",
"GB"
],
"country_is_not": [
"CN",
"RU"
],
"action": "redirect",
"action_config": {
"error_page_path": "/fr/_quant404",
"status_codes": [
"404"
]
}
}

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
}

Another request is changing this project’s rules, or the rule is managed in code. Retry after a short delay; a managed rule changes only through a rules deploy.

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

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

The rule order cannot be kept (two rules managed in code leave no legal weight). Permanent until support repairs the order; do not retry.

Media typeapplication/json
object
message
required

Error message

string
error
required

Error flag

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