Skip to content
Start here

List WAF packages

Deprecated
client.firewall.waf.packages.list(PackageListParams { zone_id, direction, match, 4 more } params, RequestOptionsoptions?): V4PagePaginationArray<PackageListResponse>
GET/zones/{zone_id}/firewall/waf/packages

Fetches WAF packages for a zone.

Note: Applies only to the previous version of WAF managed rules.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Firewall Services WriteFirewall Services Read
ParametersExpand Collapse
params: PackageListParams { zone_id, direction, match, 4 more }
zone_id: string

Path param: Defines an identifier.

maxLength32
direction?: "asc" | "desc"

Query param: The direction used to sort returned packages.

One of the following:
"asc"
"desc"
match?: "any" | "all"

Query param: When set to all, all the search requirements must match. When set to any, only one of the search requirements has to match.

One of the following:
"any"
"all"
name?: string

Query param: The name of the WAF package.

order?: "name"

Query param: The field used to sort returned packages.

page?: number

Query param: The page number of paginated results.

minimum1
per_page?: number

Query param: The number of packages per page.

maximum100
minimum5
ReturnsExpand Collapse
PackageListResponse = unknown

List WAF packages

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const packageListResponse of client.firewall.waf.packages.list({
  zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
})) {
  console.log(packageListResponse);
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {}
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {}
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}