Skip to content

Update a custom response rule

PATCH
/api/v2/organizations/{organization}/projects/{project}/rules/custom-response/{rule}

Authorizations

Parameters

Path Parameters

organization
required
string

Organization identifier

project
required
string

Project identifier

rule
required
string

Rule identifier

Request Body required

object
domain
required

Domain patterns (default: any)

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

Rule name

string
Test custom response rule
uuid

Rule UUID

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

Rule weight

integer
100
disabled

Whether rule is disabled

boolean
url
required

URL patterns

Array<string>
[
"/maintenance",
"/down"
]
country

Country filter type (country_is, country_is_not, any)

string
country_is
country_is

Allowed countries

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

Excluded countries

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

Method filter type (method_is, method_is_not, any)

string
method_is
method_is

Allowed HTTP methods

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

Excluded HTTP methods

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

IP filter type (ip_is, ip_is_not, any)

string
ip_is
ip_is

Allowed IP addresses

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

Excluded IP addresses

Array<string>
[
"172.16.0.0/12"
]
custom_response_body
required

Custom response body content

string
<html><body>Custom maintenance page</body></html>
custom_response_status_code

HTTP status code for custom response

integer
default: 200
503
status_code

Legacy field for status code (deprecated)

integer
503
body

Legacy field for response body (deprecated)

string
<html><body>Maintenance</body></html>

Responses

200

The request has succeeded.

object
name

Rule name

string
Test redirect rule
uuid
required

Rule UUID

string
123e4567-e89b-12d3-a456-426614174000
rule_id

Rule ID

string
rule-001
weight

Rule weight

integer
100
url

URL patterns

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

Domain patterns

Array<string>
[
"test-domain.com",
"*.test-domain.com"
]
disabled
required

Whether rule is disabled

boolean
only_with_cookie

Only apply with cookie

string
session_id
method

HTTP method

string
GET
method_is

Allowed HTTP methods

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

Excluded HTTP methods

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

IP address

string
192.168.1.1
ip_is

Allowed IP addresses

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

Excluded IP addresses

Array<string>
[
"172.16.0.0/12"
]
country

Country code

string
US
country_is

Allowed countries

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

Excluded countries

Array<string>
[
"CN",
"RU"
]
action
required

Rule action

string
redirect
action_config
object
custom_response_body
required

Custom response body content

string
<html><body>Custom maintenance page</body></html>
custom_response_status_code

HTTP status code for custom response

integer
default: 200
503

400

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

object
message
required

Error message

string
The requested resource was not found
error
required

Error flag

boolean
true

403

Access is forbidden.

object
message
required

Error message

string
The requested resource was not found
error
required

Error flag

boolean
true