Create a custom error page rule
const url = 'https://dashboard.quantcdn.io/api/v2/organizations/example/projects/example/rules/error-page';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"],"schedule":{"timezone":"Australia/Sydney","mode":"active_during","weekly":[{"days":["sat","sun"],"start":"22:00","end":"07:00"}],"once":[{"start":"2026-12-24T18:00","end":"2026-12-27T09:00"}]},"cookie_name":"session_id","error_page_path":"/fr/_quant404","status_codes":["404"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dashboard.quantcdn.io/api/v2/organizations/example/projects/example/rules/error-page \ --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" ], "schedule": { "timezone": "Australia/Sydney", "mode": "active_during", "weekly": [ { "days": [ "sat", "sun" ], "start": "22:00", "end": "07:00" } ], "once": [ { "start": "2026-12-24T18:00", "end": "2026-12-27T09:00" } ] }, "cookie_name": "session_id", "error_page_path": "/fr/_quant404", "status_codes": [ "404" ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization identifier
Project identifier
Request Bodyrequired
Section titled “Request Bodyrequired”object
Exact hostnames the rule matches, or ‘any’ (the default). Wildcards such as *.example.com are not supported.
Example
[ "test-domain.com", "www.test-domain.com"]Rule name
Example
Test redirect ruleRule UUID
Example
123e4567-e89b-12d3-a456-426614174000Rule 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.
Example
100Whether rule is disabled
Example
falseURL patterns
Example
[ "/old-path/*", "/legacy/*"]Country filter type (country_is, country_is_not, any)
Example
country_isAllowed countries
Example
[ "US", "CA", "GB"]Excluded countries
Example
[ "CN", "RU"]Method filter type (method_is, method_is_not, any)
Example
method_isAllowed HTTP methods
Example
[ "GET", "POST"]Excluded HTTP methods
Example
[ "DELETE", "PUT"]IP filter type (ip_is, ip_is_not, any)
Example
ip_isAllowed IP addresses
Example
[ "192.168.1.0/24", "10.0.0.1"]Excluded IP addresses
Example
[ "172.16.0.0/12"]ASN filter type (asn_is, asn_is_not, any). A PATCH that omits it keeps the current value. Invalid values return 422.
Example
asn_isAllowed AS numbers. Positive integers up to 4294967295, stored as strings. A PATCH replaces the list.
Example
[ "15169"]Excluded AS numbers. Positive integers up to 4294967295, stored as strings. A PATCH replaces the list.
Example
[ "13335"]User agent filter type (ua_is, ua_is_not, any). Invalid values return 422.
Example
ua_isUser agent strings to match. Each item has at most 255 characters. A PATCH replaces the list.
Example
[ "Googlebot"]User agent strings to exclude. Each item has at most 255 characters. A PATCH replaces the list.
Example
[ "curl"]Traffic source filter type (traffic_source_is, traffic_source_is_not, any). Invalid values return 422.
Example
traffic_source_isTraffic sources to match. A PATCH replaces the list.
Example
[ "tor-exit"]Traffic sources to exclude. A PATCH replaces the list.
Example
[ "crawler"]Weekly windows and one-off ranges in local wall time for one IANA time zone. Start is inclusive, end is exclusive. A weekly window whose end is not later than its start crosses midnight. With no windows the rule always applies.
object
IANA time zone name, or UTC. Invalid values return 422.
Example
Australia/SydneyActive_during: the rule applies only inside the windows. inactive_during: the rule applies only outside them.
Example
active_duringWeekly windows. Stored as an empty list when omitted.
object
Example
[ "sat", "sun"]Local time HH:MM, 00:00 to 23:59.
Example
22:00Local time HH:MM, 00:00 to 24:00.
Example
07:00One-off ranges. Stored as an empty list when omitted.
object
Local date and time, YYYY-MM-DDTHH:MM, no offset.
Example
2026-12-24T18:00Local date and time after start, YYYY-MM-DDTHH:MM, no offset.
Example
2026-12-27T09:00Write name of only_with_cookie: the rule applies only when this cookie is present. Empty string clears it.
Example
session_idPublished path of the page to serve as the error page
Example
/fr/_quant404Status codes this page is served for
Example
[ "404"]Responses
Section titled “Responses”The request has succeeded.
object
Rule name
Rule UUID
Rule ID
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.
URL patterns
Exact hostnames the rule matches, or ‘any’. Wildcards are not supported.
Whether rule is disabled
Only apply with cookie
HTTP method
Allowed HTTP methods
Excluded HTTP methods
IP address
Allowed IP addresses
Excluded IP addresses
ASN condition type (asn_is, asn_is_not, any)
Allowed AS numbers
Excluded AS numbers
User agent condition type (ua_is, ua_is_not, any)
User agent strings to match
User agent strings to exclude
Traffic source condition type (traffic_source_is, traffic_source_is_not, any)
Traffic sources to match (cloud, vpn, tor-exit, abuser, crawler)
Traffic sources to exclude (cloud, vpn, tor-exit, abuser, crawler)
Weekly windows and one-off ranges in local wall time for one IANA time zone. Start is inclusive, end is exclusive. A weekly window whose end is not later than its start crosses midnight. With no windows the rule always applies.
object
IANA time zone name, or UTC. Invalid values return 422.
Active_during: the rule applies only inside the windows. inactive_during: the rule applies only outside them.
Weekly windows. Stored as an empty list when omitted.
object
Local time HH:MM, 00:00 to 23:59.
Local time HH:MM, 00:00 to 24:00.
One-off ranges. Stored as an empty list when omitted.
object
Local date and time, YYYY-MM-DDTHH:MM, no offset.
Local date and time after start, YYYY-MM-DDTHH:MM, no offset.
Country code
Allowed countries
Excluded countries
Rule action
object
Published path of the page to serve as the error page
Status codes this page is served for
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" ], "schedule": { "timezone": "Australia/Sydney", "mode": "active_during", "weekly": [ { "days": [ "sat", "sun" ], "start": "22:00", "end": "07:00" } ], "once": [ { "start": "2026-12-24T18:00", "end": "2026-12-27T09:00" } ] }, "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.
object
Error message
Error flag
Example
{ "message": "The requested resource was not found", "error": true}Access is forbidden.
object
Error message
Error flag
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.
object
Error message
Error flag
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.
object
Error message
Error flag
Example
{ "message": "The requested resource was not found", "error": true}