List IP Access rules

Fetches IP Access rules of a zone. You can filter the results using several optional parameters.

/zones/{zone_id}/firewall/access_rules/rules

get

IP Access rules for a zone

ip-access-rules-for-a-zone-list-ip-access-rules

Debug "planAvailability"

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

Debug "tokenPermissions"

null

Debug "parameters"

[
  {
    "in": "path",
    "name": "zone_id",
    "required": true,
    "schema": {
      "description": "Identifier",
      "example": "023e105f4ecef8ad9ca31a8372d0c353",
      "maxLength": 32,
      "readOnly": true,
      "type": "string"
    }
  },
  {
    "in": "query",
    "name": "filters",
    "schema": {
      "properties": {
        "configuration.target": {
          "description": "The target to search in existing rules.",
          "enum": [
            "ip",
            "ip_range",
            "asn",
            "country"
          ],
          "example": "ip",
          "type": "string"
        },
        "configuration.value": {
          "description": "The target value to search for in existing rules: an IP address, an IP address range, or a country code, depending on the provided `configuration.target`.\nNotes: You can search for a single IPv4 address, an IP address range with a subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code.",
          "example": "198.51.100.4",
          "type": "string"
        },
        "match": {
          "default": "all",
          "description": "When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",
          "enum": [
            "any",
            "all"
          ],
          "type": "string"
        },
        "mode": {
          "description": "The action to apply to a matched request.",
          "enum": [
            "block",
            "challenge",
            "whitelist",
            "js_challenge",
            "managed_challenge"
          ],
          "example": "challenge",
          "type": "string"
        },
        "notes": {
          "description": "The string to search for in the notes of existing IP Access rules.\nNotes: For example, the string 'attack' would match IP Access rules with notes 'Attack 26/02' and 'Attack 27/02'. The search is case insensitive.",
          "example": "my note",
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  {
    "in": "query",
    "name": "egs-pagination.json",
    "schema": {
      "properties": {
        "page": {
          "default": 1,
          "description": "The page number of paginated results.",
          "minimum": 1,
          "type": "number"
        },
        "per_page": {
          "default": 20,
          "description": "The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`.",
          "maximum": 1000,
          "minimum": 1,
          "type": "number"
        }
      },
      "type": "object"
    }
  },
  {
    "in": "query",
    "name": "page",
    "schema": {
      "description": "Requested page within paginated list of results.",
      "example": 1,
      "type": "number"
    }
  },
  {
    "in": "query",
    "name": "per_page",
    "schema": {
      "description": "Maximum number of results requested.",
      "example": 20,
      "type": "number"
    }
  },
  {
    "in": "query",
    "name": "order",
    "schema": {
      "description": "The field used to sort returned rules.",
      "enum": [
        "configuration.target",
        "configuration.value",
        "mode"
      ],
      "example": "mode",
      "type": "string"
    }
  },
  {
    "in": "query",
    "name": "direction",
    "schema": {
      "description": "The direction used to sort returned rules.",
      "enum": [
        "asc",
        "desc"
      ],
      "example": "desc",
      "type": "string"
    }
  }
]

Debug "requestBody"

null

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": {
                      "items": {},
                      "nullable": true,
                      "type": "array"
                    },
                    "result_info": {
                      "properties": {
                        "count": {
                          "description": "Total number of results for the requested service",
                          "example": 1,
                          "type": "number"
                        },
                        "page": {
                          "description": "Current page within paginated list of results",
                          "example": 1,
                          "type": "number"
                        },
                        "per_page": {
                          "description": "Number of results per page of results",
                          "example": 20,
                          "type": "number"
                        },
                        "total_count": {
                          "description": "Total results available without any search parameters",
                          "example": 2000,
                          "type": "number"
                        }
                      },
                      "type": "object"
                    }
                  }
                }
              ],
              "type": "object"
            },
            {
              "properties": {
                "result": {
                  "items": {
                    "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"
                  },
                  "type": "array"
                }
              }
            }
          ]
        }
      }
    },
    "description": "List IP Access rules 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": {
                          "items": {},
                          "nullable": true,
                          "type": "array"
                        },
                        "result_info": {
                          "properties": {
                            "count": {
                              "description": "Total number of results for the requested service",
                              "example": 1,
                              "type": "number"
                            },
                            "page": {
                              "description": "Current page within paginated list of results",
                              "example": 1,
                              "type": "number"
                            },
                            "per_page": {
                              "description": "Number of results per page of results",
                              "example": 20,
                              "type": "number"
                            },
                            "total_count": {
                              "description": "Total results available without any search parameters",
                              "example": 2000,
                              "type": "number"
                            }
                          },
                          "type": "object"
                        }
                      }
                    }
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "items": {
                        "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"
                      },
                      "type": "array"
                    }
                  }
                }
              ]
            },
            {
              "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": "List IP Access rules response failure"
  }
}

Debug "security"

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