Create a custom response rule
POST /api/v2/organizations/{organization}/projects/{project}/rules/custom-response
Authorizations
Parameters
Path Parameters
Organization identifier
Project identifier
Request Body required
object
Domain patterns (default: any)
[ "test-domain.com", "*.test-domain.com"]Rule name
Test custom response ruleRule UUID
123e4567-e89b-12d3-a456-426614174000Rule weight
100Whether rule is disabled
URL patterns
[ "/maintenance", "/down"]Country filter type (country_is, country_is_not, any)
country_isAllowed countries
[ "US", "CA", "GB"]Excluded countries
[ "CN", "RU"]Method filter type (method_is, method_is_not, any)
method_isAllowed HTTP methods
[ "GET", "POST"]Excluded HTTP methods
[ "DELETE", "PUT"]IP filter type (ip_is, ip_is_not, any)
ip_isAllowed IP addresses
[ "192.168.1.0/24", "10.0.0.1"]Excluded IP addresses
[ "172.16.0.0/12"]Custom response body content
<html><body>Custom maintenance page</body></html>HTTP status code for custom response
503Legacy field for status code (deprecated)
503Legacy field for response body (deprecated)
<html><body>Maintenance</body></html>Responses
200
The request has succeeded.
object
Rule name
Test redirect ruleRule UUID
123e4567-e89b-12d3-a456-426614174000Rule ID
rule-001Rule weight
100URL patterns
[ "/old-path/*", "/legacy/*"]Domain patterns
[ "test-domain.com", "*.test-domain.com"]Whether rule is disabled
Only apply with cookie
session_idHTTP method
GETAllowed HTTP methods
[ "GET", "POST"]Excluded HTTP methods
[ "DELETE", "PUT"]IP address
192.168.1.1Allowed IP addresses
[ "192.168.1.0/24", "10.0.0.1"]Excluded IP addresses
[ "172.16.0.0/12"]Country code
USAllowed countries
[ "US", "CA", "GB"]Excluded countries
[ "CN", "RU"]Rule action
redirectobject
Custom response body content
<html><body>Custom maintenance page</body></html>HTTP status code for custom response
503400
The server could not understand the request due to invalid syntax.
object
Error message
The requested resource was not foundError flag
true403
Access is forbidden.
object
Error message
The requested resource was not foundError flag
true