---
title: Rules
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[Firewall](https://developers.cloudflare.com/api/go/resources/firewall)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Rules

##### [List firewall rules](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/list)

Deprecated

client.Firewall.Rules.List(ctx, params) (\*V4PagePaginationArray\[[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>)], error)

GET/zones/{zone\_id}/firewall/rules

##### [Get a firewall rule](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/get)

Deprecated

client.Firewall.Rules.Get(ctx, ruleID, query) (\*[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>), error)

GET/zones/{zone\_id}/firewall/rules/{rule\_id}

##### [Create firewall rules](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/create)

Deprecated

client.Firewall.Rules.New(ctx, params) (\*SinglePage\[[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>)], error)

POST/zones/{zone\_id}/firewall/rules

##### [Update a firewall rule](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/update)

Deprecated

client.Firewall.Rules.Update(ctx, ruleID, params) (\*[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>), error)

PUT/zones/{zone\_id}/firewall/rules/{rule\_id}

##### [Update priority of a firewall rule](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/edit)

Deprecated

client.Firewall.Rules.Edit(ctx, ruleID, body) (\*SinglePage\[[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>)], error)

PATCH/zones/{zone\_id}/firewall/rules/{rule\_id}

##### [Delete a firewall rule](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/delete)

Deprecated

client.Firewall.Rules.Delete(ctx, ruleID, body) (\*[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>), error)

DELETE/zones/{zone\_id}/firewall/rules/{rule\_id}

##### [Update firewall rules](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/bulk_update)

Deprecated

client.Firewall.Rules.BulkUpdate(ctx, params) (\*SinglePage\[[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>)], error)

PUT/zones/{zone\_id}/firewall/rules

##### [Update priority of firewall rules](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/bulk_edit)

Deprecated

client.Firewall.Rules.BulkEdit(ctx, params) (\*SinglePage\[[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>)], error)

PATCH/zones/{zone\_id}/firewall/rules

##### [Delete firewall rules](https://developers.cloudflare.com/api/go/resources/firewall/subresources/rules/methods/bulk_delete)

Deprecated

client.Firewall.Rules.BulkDelete(ctx, body) (\*SinglePage\[[FirewallRule](<https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>)], error)

DELETE/zones/{zone\_id}/firewall/rules

##### ModelsExpand Collapse

<details>

<summary>

type DeletedFilter struct{…}

</summary>

ID string

The unique identifier of the filter.

maxLength32

minLength32

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20deleted_filter%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Deleted bool

When true, indicates that the firewall rule was deleted.

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20deleted_filter%20%3E%20(schema)%20%3E%20(property)%20deleted">Link to this property</a>

</details>

[Link to this property](<#(resource)%20firewall.rules%20%3E%20(model)%20deleted_filter%20%3E%20(schema)>)

<details>

<summary>

type FirewallRule struct{…}

</summary>

ID stringOptional

The unique identifier of the firewall rule.

maxLength32

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Action <a href="https://developers.cloudflare.com/api/go/resources/rate_limits#(resource)%20rate_limits%20%3E%20(model)%20action%20%3E%20(schema)">Action</a>Optional

The action to apply to a matched request. The <code>log</code> action is only available on an Enterprise plan.

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)%20%3E%20(property)%20action">Link to this property</a>

Description stringOptional

An informative summary of the firewall rule.

maxLength500

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

<details>

<summary>

Filter FirewallRuleFilterOptional

</summary>

One of the following:

<details>

<summary>

type FirewallFilter struct{…}

</summary>

ID stringOptional

The unique identifier of the filter.

maxLength32

minLength32

<a href="#(resource)%20filters%20%3E%20(model)%20firewall_filter%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Description stringOptional

An informative summary of the filter.

maxLength500

<a href="#(resource)%20filters%20%3E%20(model)%20firewall_filter%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

Expression stringOptional

The filter expression. For more information, refer to <a href="https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/">Expressions</a>.

<a href="#(resource)%20filters%20%3E%20(model)%20firewall_filter%20%3E%20(schema)%20%3E%20(property)%20expression">Link to this property</a>

Paused boolOptional

When true, indicates that the filter is currently paused.

<a href="#(resource)%20filters%20%3E%20(model)%20firewall_filter%20%3E%20(schema)%20%3E%20(property)%20paused">Link to this property</a>

Ref stringOptional

A short reference tag. Allows you to select related filters.

maxLength50

<a href="#(resource)%20filters%20%3E%20(model)%20firewall_filter%20%3E%20(schema)%20%3E%20(property)%20ref">Link to this property</a>

</details>

<a href="#(resource)%20filters%20%3E%20(model)%20firewall_filter%20%3E%20(schema)">Link to this property</a>

<details>

<summary>

type DeletedFilter struct{…}

</summary>

ID string

The unique identifier of the filter.

maxLength32

minLength32

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20deleted_filter%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Deleted bool

When true, indicates that the firewall rule was deleted.

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20deleted_filter%20%3E%20(schema)%20%3E%20(property)%20deleted">Link to this property</a>

</details>

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20deleted_filter%20%3E%20(schema)">Link to this property</a>

</details>

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)%20%3E%20(property)%20filter">Link to this property</a>

Paused boolOptional

When true, indicates that the firewall rule is currently paused.

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)%20%3E%20(property)%20paused">Link to this property</a>

Priority float64Optional

The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority.

maximum2147483647

minimum0

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)%20%3E%20(property)%20priority">Link to this property</a>

<details>

<summary>

Products \[]<a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a>Optional

</summary>

One of the following:

const ProductZoneLockdown <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "zoneLockdown"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>

const ProductUABlock <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "uaBlock"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>

const ProductBIC <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "bic"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%202">Link to this property</a>

const ProductHot <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "hot"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%203">Link to this property</a>

const ProductSecurityLevel <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "securityLevel"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%204">Link to this property</a>

const ProductRateLimit <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "rateLimit"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%205">Link to this property</a>

const ProductWAF <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "waf"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%206">Link to this property</a>

</details>

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)%20%3E%20(property)%20products">Link to this property</a>

Ref stringOptional

A short reference tag. Allows you to select related firewall rules.

maxLength50

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)%20%3E%20(property)%20ref">Link to this property</a>

</details>

[Link to this property](<#(resource)%20firewall.rules%20%3E%20(model)%20firewall_rule%20%3E%20(schema)>)

<details>

<summary>

type Product string

A list of products to bypass for a request when using the <code>bypass</code> action.

</summary>

One of the following:

const ProductZoneLockdown <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "zoneLockdown"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>

const ProductUABlock <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "uaBlock"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>

const ProductBIC <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "bic"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%202">Link to this property</a>

const ProductHot <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "hot"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%203">Link to this property</a>

const ProductSecurityLevel <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "securityLevel"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%204">Link to this property</a>

const ProductRateLimit <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "rateLimit"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%205">Link to this property</a>

const ProductWAF <a href="https://developers.cloudflare.com/api/go/resources/firewall#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)">Product</a> = "waf"

<a href="#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)%20%3E%20(member)%206">Link to this property</a>

</details>

[Link to this property](<#(resource)%20firewall.rules%20%3E%20(model)%20product%20%3E%20(schema)>)