Skip to content
Start here

Policies

List Page Shield policies
client.pageShield.policies.list(PolicyListParams { zone_id } params, RequestOptionsoptions?): SinglePage<PolicyListResponse { id, action, description, 3 more } >
GET/zones/{zone_id}/page_shield/policies
Get a Page Shield policy
client.pageShield.policies.get(stringpolicyId, PolicyGetParams { zone_id } params, RequestOptionsoptions?): PolicyGetResponse { id, action, description, 3 more } | null
GET/zones/{zone_id}/page_shield/policies/{policy_id}
Create a Page Shield policy
client.pageShield.policies.create(PolicyCreateParams { zone_id, action, description, 3 more } params, RequestOptionsoptions?): PolicyCreateResponse { id, action, description, 3 more } | null
POST/zones/{zone_id}/page_shield/policies
Update a Page Shield policy
client.pageShield.policies.update(stringpolicyId, PolicyUpdateParams { zone_id, action, description, 3 more } params, RequestOptionsoptions?): PolicyUpdateResponse { id, action, description, 3 more } | null
PUT/zones/{zone_id}/page_shield/policies/{policy_id}
Delete a Page Shield policy
client.pageShield.policies.delete(stringpolicyId, PolicyDeleteParams { zone_id } params, RequestOptionsoptions?): void
DELETE/zones/{zone_id}/page_shield/policies/{policy_id}
ModelsExpand Collapse
Policy { action, description, enabled, 2 more }
action: "allow" | "log" | "add_reporting_directives"

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: string

A description for the policy

enabled: boolean

Whether the policy is enabled

expression: string

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

value: string

The policy which will be applied

PolicyListResponse { id, action, description, 3 more }
id: string

Identifier

maxLength32
action: "allow" | "log" | "add_reporting_directives"

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: string

A description for the policy

enabled: boolean

Whether the policy is enabled

expression: string

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

value: string

The policy which will be applied

PolicyGetResponse { id, action, description, 3 more }
id: string

Identifier

maxLength32
action: "allow" | "log" | "add_reporting_directives"

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: string

A description for the policy

enabled: boolean

Whether the policy is enabled

expression: string

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

value: string

The policy which will be applied

PolicyCreateResponse { id, action, description, 3 more }
id: string

Identifier

maxLength32
action: "allow" | "log" | "add_reporting_directives"

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: string

A description for the policy

enabled: boolean

Whether the policy is enabled

expression: string

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

value: string

The policy which will be applied

PolicyUpdateResponse { id, action, description, 3 more }
id: string

Identifier

maxLength32
action: "allow" | "log" | "add_reporting_directives"

The action to take if the expression matches

One of the following:
"allow"
"log"
"add_reporting_directives"
description: string

A description for the policy

enabled: boolean

Whether the policy is enabled

expression: string

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

value: string

The policy which will be applied