Update an IP Access rule

Updates an IP Access rule defined at the account level. Note: This operation will affect all zones in the account.

/accounts/{account_identifier}/firewall/access_rules/rules/{identifier}

patch

IP Access rules for an account

ip-access-rules-for-an-account-update-an-ip-access-rule

Debug "planAvailability"

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

Debug "tokenPermissions"

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

Debug "parameters"

[
  {
    "in": "path",
    "name": "identifier",
    "required": true,
    "schema": {}
  },
  {
    "in": "path",
    "name": "account_identifier",
    "required": true,
    "schema": {}
  }
]

Debug "requestBody"

{
  "content": {
    "application/json": {
      "schema": {
        "allOf": [
          {
            "properties": {
              "allowed_modes": {
                "description": "The available actions that a rule can apply to a matched request.",
                "example": [
                  "whitelist",
                  "block",
                  "challenge",
                  "js_challenge",
                  "managed_challenge"
                ],
                "items": {
                  "description": "The action to apply to a matched request.",
                  "enum": [
                    "block",
                    "challenge",
                    "whitelist",
                    "js_challenge",
                    "managed_challenge"
                  ],
                  "example": "challenge",
                  "type": "string"
                },
                "readOnly": true,
                "type": "array"
              },
              "configuration": {
                "description": "The rule configuration.",
                "oneOf": [
                  {
                    "properties": {
                      "target": {
                        "description": "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",
                        "enum": [
                          "ip"
                        ],
                        "example": "ip"
                      },
                      "value": {
                        "description": "The IP address to match. This address will be compared to the IP address of incoming requests.",
                        "example": "198.51.100.4",
                        "type": "string"
                      }
                    },
                    "title": "An IP address configuration."
                  },
                  {
                    "properties": {
                      "target": {
                        "description": "The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule.",
                        "enum": [
                          "ip6"
                        ],
                        "example": "ip6"
                      },
                      "value": {
                        "description": "The IPv6 address to match.",
                        "example": "2001:DB8:100::CF",
                        "type": "string"
                      }
                    },
                    "title": "An IPv6 address configuration."
                  },
                  {
                    "properties": {
                      "target": {
                        "description": "The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule.",
                        "enum": [
                          "ip_range"
                        ],
                        "example": "ip_range"
                      },
                      "value": {
                        "description": "The IP address range to match. You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.",
                        "example": "198.51.100.4/16",
                        "type": "string"
                      }
                    },
                    "title": "An IP address range configuration."
                  },
                  {
                    "properties": {
                      "target": {
                        "description": "The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule.",
                        "enum": [
                          "asn"
                        ],
                        "example": "asn"
                      },
                      "value": {
                        "description": "The AS number to match.",
                        "example": "AS12345",
                        "type": "string"
                      }
                    },
                    "title": "An ASN configuration."
                  },
                  {
                    "properties": {
                      "target": {
                        "description": "The configuration target. You must set the target to `country` when specifying a country code in the rule.",
                        "enum": [
                          "country"
                        ],
                        "example": "country"
                      },
                      "value": {
                        "description": "The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country).",
                        "example": "US",
                        "type": "string"
                      }
                    },
                    "title": "A country configuration."
                  }
                ],
                "type": "object"
              },
              "created_on": {
                "description": "The timestamp of when the rule was created.",
                "example": "2014-01-01T05:20:00.12345Z",
                "format": "date-time",
                "readOnly": true,
                "type": "string"
              },
              "id": {
                "description": "The unique identifier of the IP Access rule.",
                "example": "92f17202ed8bd63d69a66b86a49a8f6b",
                "maxLength": 32,
                "readOnly": true,
                "type": "string"
              },
              "mode": {
                "description": "The action to apply to a matched request.",
                "enum": [
                  "block",
                  "challenge",
                  "whitelist",
                  "js_challenge",
                  "managed_challenge"
                ],
                "example": "challenge",
                "type": "string"
              },
              "modified_on": {
                "description": "The timestamp of when the rule was last modified.",
                "example": "2014-01-01T05:20:00.12345Z",
                "format": "date-time",
                "readOnly": true,
                "type": "string"
              },
              "notes": {
                "description": "An informative summary of the rule, typically used as a reminder or explanation.",
                "example": "This rule is enabled because of an event that occurred on date X.",
                "type": "string"
              }
            },
            "required": [
              "id",
              "mode",
              "allowed_modes",
              "configuration"
            ],
            "type": "object"
          },
          {
            "properties": {
              "scope": {
                "description": "All zones owned by the user will have the rule applied.",
                "properties": {
                  "email": {
                    "description": "The contact email address of the user.",
                    "example": "user@example.com",
                    "maxLength": 90,
                    "type": "string"
                  },
                  "id": {
                    "description": "Identifier",
                    "example": "023e105f4ecef8ad9ca31a8372d0c353",
                    "maxLength": 32,
                    "readOnly": true,
                    "type": "string"
                  },
                  "type": {
                    "description": "The scope of the rule.",
                    "enum": [
                      "user",
                      "organization"
                    ],
                    "example": "user",
                    "readOnly": true
                  }
                },
                "readOnly": true,
                "type": "object"
              }
            }
          }
        ],
        "required": [
          "id",
          "mode",
          "allowed_modes",
          "configuration",
          "scope"
        ],
        "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"
                        }
                      ],
                      "nullable": true
                    }
                  }
                }
              ],
              "type": "object"
            },
            {
              "properties": {
                "result": {
                  "type": "object"
                }
              },
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "Update an IP Access 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"
                            }
                          ],
                          "nullable": true
                        }
                      }
                    }
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "type": "object"
                    }
                  },
                  "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": "Update an IP Access rule response failure"
  }
}

Debug "security"

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