---
title: Rules
---

[Skip to content](#_top)

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

[Snippets](https://developers.cloudflare.com/api/python/resources/snippets)

Copy Markdown

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

---

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

# Rules

##### [List zone snippet rules](https://developers.cloudflare.com/api/python/resources/snippets/subresources/rules/methods/get)

snippets.rules.get(RuleGetParams\*\*kwargs) -> SyncSinglePage\[[RuleGetResponse](<https://developers.cloudflare.com/api/python/resources/snippets#(resource)%20snippets.rules%20%3E%20(model)%20rule_get_response%20%3E%20(schema)>)]

GET/zones/{zone\_id}/snippets/snippet\_rules

##### [List zone snippet rules](https://developers.cloudflare.com/api/python/resources/snippets/subresources/rules/methods/list)

snippets.rules.list(RuleListParams\*\*kwargs) -> SyncSinglePage\[[RuleListResponse](<https://developers.cloudflare.com/api/python/resources/snippets#(resource)%20snippets.rules%20%3E%20(model)%20rule_list_response%20%3E%20(schema)>)]

GET/zones/{zone\_id}/snippets/snippet\_rules

##### [Update zone snippet rules](https://developers.cloudflare.com/api/python/resources/snippets/subresources/rules/methods/update)

snippets.rules.update(RuleUpdateParams\*\*kwargs) -> SyncSinglePage\[[RuleUpdateResponse](<https://developers.cloudflare.com/api/python/resources/snippets#(resource)%20snippets.rules%20%3E%20(model)%20rule_update_response%20%3E%20(schema)>)]

PUT/zones/{zone\_id}/snippets/snippet\_rules

##### [Delete zone snippet rules](https://developers.cloudflare.com/api/python/resources/snippets/subresources/rules/methods/delete)

snippets.rules.delete(RuleDeleteParams\*\*kwargs) -> SyncSinglePage\[[RuleDeleteResponse](<https://developers.cloudflare.com/api/python/resources/snippets#(resource)%20snippets.rules%20%3E%20(model)%20rule_delete_response%20%3E%20(schema)>)]

DELETE/zones/{zone\_id}/snippets/snippet\_rules

##### ModelsExpand Collapse

<details>

<summary>

class RuleGetResponse: …

Define a snippet rule.

</summary>

id: str

Specify the unique ID of the rule.

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

expression: str

Define the expression that determines which traffic matches the rule.

minLength1

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

last\_updated: datetime

Specify the timestamp of when the rule was last modified.

formatdate-time

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

snippet\_name: str

Identify the snippet.

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

description: Optional\[str]

Provide an informative description of the rule.

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

enabled: Optional\[bool]

Indicate whether to execute the rule.

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

</details>

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

<details>

<summary>

class RuleListResponse: …

Define a snippet rule.

</summary>

id: str

Specify the unique ID of the rule.

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

expression: str

Define the expression that determines which traffic matches the rule.

minLength1

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

last\_updated: datetime

Specify the timestamp of when the rule was last modified.

formatdate-time

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

snippet\_name: str

Identify the snippet.

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

description: Optional\[str]

Provide an informative description of the rule.

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

enabled: Optional\[bool]

Indicate whether to execute the rule.

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

</details>

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

<details>

<summary>

class RuleUpdateResponse: …

Define a snippet rule.

</summary>

id: str

Specify the unique ID of the rule.

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

expression: str

Define the expression that determines which traffic matches the rule.

minLength1

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

last\_updated: datetime

Specify the timestamp of when the rule was last modified.

formatdate-time

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

snippet\_name: str

Identify the snippet.

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

description: Optional\[str]

Provide an informative description of the rule.

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

enabled: Optional\[bool]

Indicate whether to execute the rule.

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

</details>

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

<details>

<summary>

class RuleDeleteResponse: …

Define a snippet rule.

</summary>

id: str

Specify the unique ID of the rule.

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

expression: str

Define the expression that determines which traffic matches the rule.

minLength1

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

last\_updated: datetime

Specify the timestamp of when the rule was last modified.

formatdate-time

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

snippet\_name: str

Identify the snippet.

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

description: Optional\[str]

Provide an informative description of the rule.

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

enabled: Optional\[bool]

Indicate whether to execute the rule.

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

</details>

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