Edit a Page Rule

Updates one or more fields of an existing Page Rule.

/zones/{zone_identifier}/pagerules/{identifier}

patch

Page Rules

page-rules-edit-a-page-rule

Debug "planAvailability"

{
  "business": true,
  "enterprise": true,
  "free": true,
  "pro": true
}

Debug "tokenPermissions"

{
  "enum": [
    "#zone:edit"
  ]
}

Debug "parameters"

[
  {
    "in": "path",
    "name": "identifier",
    "required": true,
    "schema": {
      "description": "Identifier",
      "example": "023e105f4ecef8ad9ca31a8372d0c353",
      "maxLength": 32,
      "readOnly": true,
      "type": "string"
    }
  },
  {
    "in": "path",
    "name": "zone_identifier",
    "required": true,
    "schema": {
      "description": "Identifier",
      "example": "023e105f4ecef8ad9ca31a8372d0c353",
      "maxLength": 32,
      "readOnly": true,
      "type": "string"
    }
  }
]

Debug "requestBody"

{
  "content": {
    "application/json": {
      "schema": {
        "properties": {
          "actions": {
            "description": "The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both.",
            "example": [
              {
                "id": "browser_check",
                "value": "on"
              }
            ],
            "items": {
              "oneOf": [
                {
                  "properties": {
                    "modified_on": {
                      "description": "The timestamp of when the override was last modified.",
                      "example": "2014-01-01T05:20:00.12345Z",
                      "format": "date-time",
                      "readOnly": true,
                      "type": "string"
                    },
                    "name": {
                      "description": "The type of route.",
                      "enum": [
                        "forward_url"
                      ],
                      "example": "forward_url"
                    },
                    "value": {
                      "properties": {
                        "type": {
                          "description": "The response type for the URL redirect.",
                          "enum": [
                            "temporary",
                            "permanent"
                          ],
                          "example": "temporary"
                        },
                        "url": {
                          "description": "The URL to redirect the request to.\nNotes: ${num} refers to the position of '*' in the constraint value.",
                          "example": "http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3",
                          "type": "string"
                        }
                      }
                    }
                  },
                  "type": "object"
                }
              ]
            },
            "type": "array"
          },
          "priority": {
            "default": 1,
            "description": "The priority of the rule, used to define which Page Rule is processed over another. A higher number indicates a higher priority. For example, if you have a catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to take precedence (rule B: `/images/special/*`), specify a higher priority for rule B so it overrides rule A.",
            "type": "integer"
          },
          "status": {
            "default": "disabled",
            "description": "The status of the Page Rule.",
            "enum": [
              "active",
              "disabled"
            ],
            "example": "active",
            "type": "string"
          },
          "targets": {
            "description": "The rule targets to evaluate on each request.",
            "example": [
              {
                "constraint": {
                  "operator": "matches",
                  "value": "*example.com/images/*"
                },
                "target": "url"
              }
            ],
            "items": {
              "description": "A request condition target.",
              "oneOf": [
                {
                  "description": "URL target.",
                  "properties": {
                    "constraint": {
                      "allOf": [
                        {
                          "description": "String constraint.",
                          "properties": {
                            "operator": {
                              "default": "contains",
                              "description": "The matches operator can use asterisks and pipes as wildcard and 'or' operators.",
                              "enum": [
                                "matches",
                                "contains",
                                "equals",
                                "not_equal",
                                "not_contain"
                              ]
                            },
                            "value": {
                              "description": "The value to apply the operator to.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "operator",
                            "value"
                          ],
                          "type": "object"
                        },
                        {
                          "properties": {
                            "value": {
                              "description": "The URL pattern to match against the current request. The pattern may contain up to four asterisks ('*') as placeholders.",
                              "example": "*example.com/images/*",
                              "pattern": "^(https?://)?(([-a-zA-Z0-9*]*\\.)+[-a-zA-Z0-9]{2,20})(:(8080|8443|443|80))?(/[\\S]+)?$",
                              "type": "string"
                            }
                          }
                        }
                      ],
                      "description": "The constraint of a target.",
                      "type": "object"
                    },
                    "target": {
                      "description": "A target based on the URL of the request.",
                      "enum": [
                        "url"
                      ],
                      "example": "url"
                    }
                  },
                  "type": "object"
                }
              ],
              "required": [
                "target",
                "constraint"
              ]
            },
            "type": "array"
          }
        },
        "type": "object"
      }
    }
  },
  "required": true
}

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "properties": {
                    "errors": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "messages": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "result": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "items": {},
                          "type": "array"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "success": {
                      "description": "Whether the API call was successful",
                      "enum": [
                        true
                      ],
                      "example": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "errors",
                    "messages",
                    "result"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  }
                }
              ],
              "type": "object"
            },
            {
              "properties": {
                "result": {
                  "type": "object"
                }
              }
            }
          ]
        }
      }
    },
    "description": "Edit a Page Rule response"
  },
  "4XX": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "allOf": [
                    {
                      "properties": {
                        "errors": {
                          "example": [],
                          "items": {
                            "properties": {
                              "code": {
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "uniqueItems": true
                          },
                          "type": "array"
                        },
                        "messages": {
                          "example": [],
                          "items": {
                            "properties": {
                              "code": {
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "uniqueItems": true
                          },
                          "type": "array"
                        },
                        "result": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "items": {},
                              "type": "array"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "success": {
                          "description": "Whether the API call was successful",
                          "enum": [
                            true
                          ],
                          "example": true,
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "success",
                        "errors",
                        "messages",
                        "result"
                      ],
                      "type": "object"
                    },
                    {
                      "properties": {
                        "result": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        }
                      }
                    }
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "type": "object"
                    }
                  }
                }
              ]
            },
            {
              "properties": {
                "errors": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": [
                    {
                      "code": 7003,
                      "message": "No route for the URI"
                    }
                  ],
                  "minLength": 1
                },
                "messages": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": []
                },
                "result": {
                  "enum": [
                    null
                  ],
                  "nullable": true,
                  "type": "object"
                },
                "success": {
                  "description": "Whether the API call was successful",
                  "enum": [
                    false
                  ],
                  "example": false,
                  "type": "boolean"
                }
              },
              "required": [
                "success",
                "errors",
                "messages",
                "result"
              ],
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "Edit a Page Rule response failure"
  }
}

Debug "security"

[
  {
    "api_token": []
  },
  {
    "api_email": [],
    "api_key": []
  }
]