---
title: Policies
---

[Skip to content](#_top)

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

[Page Shield](https://developers.cloudflare.com/api/typescript/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/typescript/resources/page_shield/subresources/policies/methods/list)

client.pageShield.policies.list(PolicyListParams {zone\_id } params, RequestOptionsoptions?): SinglePage< [PolicyListResponse](<https://developers.cloudflare.com/api/typescript/resources/page_shield#(resource)%20page_shield.policies%20%3E%20(model)%20policy_list_response%20%3E%20(schema)>) {id, action, description, 3 more } >

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

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

client.pageShield.policies.get(stringpolicyID, PolicyGetParams {zone\_id } params, RequestOptionsoptions?): [PolicyGetResponse](<https://developers.cloudflare.com/api/typescript/resources/page_shield#(resource)%20page_shield.policies%20%3E%20(model)%20policy_get_response%20%3E%20(schema)>) {id, action, description, 3 more } | null

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

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

client.pageShield.policies.create(PolicyCreateParams {zone\_id, action, description, 3 more } params, RequestOptionsoptions?): [PolicyCreateResponse](<https://developers.cloudflare.com/api/typescript/resources/page_shield#(resource)%20page_shield.policies%20%3E%20(model)%20policy_create_response%20%3E%20(schema)>) {id, action, description, 3 more } | null

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

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

client.pageShield.policies.update(stringpolicyID, PolicyUpdateParams {zone\_id, action, description, 3 more } params, RequestOptionsoptions?): [PolicyUpdateResponse](<https://developers.cloudflare.com/api/typescript/resources/page_shield#(resource)%20page_shield.policies%20%3E%20(model)%20policy_update_response%20%3E%20(schema)>) {id, action, description, 3 more } | null

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

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

client.pageShield.policies.delete(stringpolicyID, PolicyDeleteParams {zone\_id } params, RequestOptionsoptions?): void

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

##### ModelsExpand Collapse

<details>

<summary>

PolicyListResponse {id, action, description, 3 more }

</summary>

id: string

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

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: boolean

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

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

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>

PolicyGetResponse {id, action, description, 3 more }

</summary>

id: string

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

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: boolean

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

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

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>

PolicyCreateResponse {id, action, description, 3 more }

</summary>

id: string

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

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: boolean

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

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

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>

PolicyUpdateResponse {id, action, description, 3 more }

</summary>

id: string

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

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: boolean

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

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

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)>)