Create an edge function rule
POST /api/v2/organizations/{organization}/projects/{project}/rules/function
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 function ruleRule UUID
123e4567-e89b-12d3-a456-426614174000Rule weight
100Whether rule is disabled
URL patterns
[ "/*"]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"]Function UUID
7c9e6679-7425-40de-944b-e07fc1f90ae7Responses
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
Function UUID
7c9e6679-7425-40de-944b-e07fc1f90ae7400
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