Skip to content
Start here

Get a WAF package

Deprecated
client.firewall.waf.packages.get(stringpackageId, PackageGetParams { zone_id } params, RequestOptionsoptions?): PackageGetResponse
GET/zones/{zone_id}/firewall/waf/packages/{package_id}

Fetches the details of a WAF package.

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
packageId: string

Defines a package identifier.

maxLength32
params: PackageGetParams { zone_id }
zone_id: string

Defines an identifier.

maxLength32
ReturnsExpand Collapse
PackageGetResponse = FirewallAPIResponseSingle { errors, messages, result, success } | Result { result }
One of the following:
FirewallAPIResponseSingle { errors, messages, result, success }
errors: Array<ResponseInfo { code, message, documentation_url, source } >
code: number
minimum1000
message: string
documentation_url?: string
source?: Source { pointer }
pointer?: string
messages: Array<ResponseInfo { code, message, documentation_url, source } >
code: number
minimum1000
message: string
documentation_url?: string
source?: Source { pointer }
pointer?: string
result: unknown | string | null
One of the following:
unknown
string | null
success: true

Defines whether the API call was successful.

Result { result }
result?: unknown

Get a WAF package

import Cloudflare from 'cloudflare';

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

const _package = await client.firewall.waf.packages.get('023e105f4ecef8ad9ca31a8372d0c353', {
  zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
});

console.log(_package);
{
  "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
}
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
}