Patch a property's rule tree
PATCH https://{{host}}/papi/v1/properties/:propertyId/versions/:propertyVersion/rules
Selectively modify a rule tree using JSON patch syntax. As a component of the larger Bulk patch a set of properties, this operation patches an individual rule tree. See Bulk Search and Update for more information. To bypass a set of validation tests that may significantly slow this operation's execution time, set the validateRules
query parameter to false
or validateMode
to fast
. See Validation best practices for guidance on when to defer validation. See Rule tree errors and warnings and Validation errors for information on how validation data is embedded within the response object.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
contractId | string | (Optional) Unique identifier for the contract. The parameter is optional if a property belongs to only one contract. Otherwise you need to specify it along with the groupId . In other operations that don't specify a propertyId URL parameter, this parameter is always required. See ID prefixes for details on omitting the value's ctr_ prefix. | |
groupId | string | (Optional) Unique identifier for the group. The parameter is optional if a property belongs to only one group. Otherwise you need to specify it along with the contractId . In other operations that don't specify a propertyId URL parameter, this parameter is always required. See ID prefixes for details on omitting the value's grp_ prefix. | |
validateRules | string | (Optional) Set to true by default. When false , skips validation tests that would identify potential problems within the response object's errors and warnings arrays. See Rule tree errors and warnings and Validation errors for information on how validation data appears in the response object. See Validation best practices for guidance on when to defer validation. | |
validateMode | string | (Optional) Enum With validateRules enabled, setting this to fast performs a quick validation check based on the provided JSON. This is faster than the default full validation, which performs more extensive checks on the converted XML metadata configuration. See Validation best practices for more guidance. | |
dryRun | string | (Optional) With the validateRules query parameter also enabled, allows for a dry run in order to gather any possible errors without saving the rule tree. See Validation best practices for more guidance. | |
accountSwitchKey | string | (Optional) For customers who manage more than one account, this runs the operation from another account. The Identity and Access Management API provides a list of available account switch keys. |
Request Body
{"0"=>{"op"=>"replace", "path"=>"/rules/options/is_secure", "value"=>true}, "1"=>{"op"=>"replace", "path"=>"/rules/children/0/name", "value"=>"Handle /my-path"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
If-Match | string | (Required) This corresponds to the ETag response header. Passing this value back as If-Match in write requests ensures you don't overwrite edits by any other API clients. See Concurrency control for details. | |
PAPI-Use-Prefixes | string | (Required) Enum Sets whether to represent ID prefixes in response data. Set to false when exchanging PAPI data with other APIs. | |
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"accountId":"act_A-CCT1234","contractId":"ctr_K-0N7RAK71","etag":"a9dfe78cf93090516bde891d009eaf57","groupId":"grp_32145","propertyId":"prp_173136","propertyName":"mytestproperty.com","propertyVersion":3,"ruleFormat":"v2015-08-08","rules":{"options":{"is_secure":false},"behaviors":[{"options":{"cacheKeyHostname":"ORIGIN_HOSTNAME","compress":true,"enableTrueClientIp":false,"forwardHostHeader":"REQUEST_HOST_HEADER","hostname":"origin.test.com","httpPort":80,"originType":"CUSTOMER"},"name":"origin"},{"options":{"value":{"id":12345,"name":"my CP code"}},"name":"cpCode"}],"children":[],"criteria":[],"name":"default"}}