---
title: Policies
---

[Skip to content](#_top)

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

[Page Shield](https://developers.cloudflare.com/api/python/resources/page_shield)

Copy Markdown

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

---

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

# Policies

##### [List content security rules](https://developers.cloudflare.com/api/python/resources/page_shield/subresources/policies/methods/list)

page\_shield.policies.list(PolicyListParams\*\*kwargs) -> SyncSinglePage\[[PolicyListResponse](<https://developers.cloudflare.com/api/python/resources/page_shield#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)>)]

GET/zones/{zone\_id}/page\_shield/policies

##### [Get a content security rule](https://developers.cloudflare.com/api/python/resources/page_shield/subresources/policies/methods/get)

page\_shield.policies.get(strpolicy\_id, PolicyGetParams\*\*kwargs) -> [PolicyGetResponse](<https://developers.cloudflare.com/api/python/resources/page_shield#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)>)

GET/zones/{zone\_id}/page\_shield/policies/{policy\_id}

##### [Create a content security rule](https://developers.cloudflare.com/api/python/resources/page_shield/subresources/policies/methods/create)

page\_shield.policies.create(PolicyCreateParams\*\*kwargs) -> [PolicyCreateResponse](<https://developers.cloudflare.com/api/python/resources/page_shield#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)>)

POST/zones/{zone\_id}/page\_shield/policies

##### [Update a content security rule](https://developers.cloudflare.com/api/python/resources/page_shield/subresources/policies/methods/update)

page\_shield.policies.update(strpolicy\_id, PolicyUpdateParams\*\*kwargs) -> [PolicyUpdateResponse](<https://developers.cloudflare.com/api/python/resources/page_shield#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)>)

PUT/zones/{zone\_id}/page\_shield/policies/{policy\_id}

##### [Delete a content security rule](https://developers.cloudflare.com/api/python/resources/page_shield/subresources/policies/methods/delete)

page\_shield.policies.delete(strpolicy\_id, PolicyDeleteParams\*\*kwargs)

DELETE/zones/{zone\_id}/page\_shield/policies/{policy\_id}

##### ModelsExpand Collapse

<details>

<summary>

class PolicyListResponse: …

</summary>

id: str

Identifier

maxLength32

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

action: Literal\["allow", "log", "add\_reporting\_directives"]

The action to take if the expression matches

</summary>

One of the following:

"allow"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%200">Link to this property</a>

"log"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%201">Link to this property</a>

"add\_reporting\_directives"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20action">Link to this property</a>

description: str

A description for the policy

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

enabled: bool

Whether the policy is enabled

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20expression">Link to this property</a>

value: str

The policy which will be applied

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)>)

<details>

<summary>

class PolicyGetResponse: …

</summary>

id: str

Identifier

maxLength32

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

action: Literal\["allow", "log", "add\_reporting\_directives"]

The action to take if the expression matches

</summary>

One of the following:

"allow"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%200">Link to this property</a>

"log"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%201">Link to this property</a>

"add\_reporting\_directives"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20action">Link to this property</a>

description: str

A description for the policy

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

enabled: bool

Whether the policy is enabled

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20expression">Link to this property</a>

value: str

The policy which will be applied

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)>)

<details>

<summary>

class PolicyCreateResponse: …

</summary>

id: str

Identifier

maxLength32

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

action: Literal\["allow", "log", "add\_reporting\_directives"]

The action to take if the expression matches

</summary>

One of the following:

"allow"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%200">Link to this property</a>

"log"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%201">Link to this property</a>

"add\_reporting\_directives"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20action">Link to this property</a>

description: str

A description for the policy

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

enabled: bool

Whether the policy is enabled

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20expression">Link to this property</a>

value: str

The policy which will be applied

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)>)

<details>

<summary>

class PolicyUpdateResponse: …

</summary>

id: str

Identifier

maxLength32

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

action: Literal\["allow", "log", "add\_reporting\_directives"]

The action to take if the expression matches

</summary>

One of the following:

"allow"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%200">Link to this property</a>

"log"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%201">Link to this property</a>

"add\_reporting\_directives"

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20action%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20action">Link to this property</a>

description: str

A description for the policy

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

enabled: bool

Whether the policy is enabled

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

expression: str

The expression which must match for the policy to be applied, using the Cloudflare Firewall rule expression syntax

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20expression">Link to this property</a>

value: str

The policy which will be applied

<a href="#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)>)