Skip to content
Start here

Policies

List Page Shield policies
page_shield.policies.list(PolicyListParams**kwargs) -> SyncSinglePage[PolicyListResponse]
GET/zones/{zone_id}/page_shield/policies
Get a Page Shield policy
page_shield.policies.get(strpolicy_id, PolicyGetParams**kwargs) -> PolicyGetResponse
GET/zones/{zone_id}/page_shield/policies/{policy_id}
Create a Page Shield policy
page_shield.policies.create(PolicyCreateParams**kwargs) -> PolicyCreateResponse
POST/zones/{zone_id}/page_shield/policies
Update a Page Shield policy
page_shield.policies.update(strpolicy_id, PolicyUpdateParams**kwargs) -> PolicyUpdateResponse
PUT/zones/{zone_id}/page_shield/policies/{policy_id}
Delete a Page Shield policy
page_shield.policies.delete(strpolicy_id, PolicyDeleteParams**kwargs)
DELETE/zones/{zone_id}/page_shield/policies/{policy_id}
ModelsExpand Collapse
class Policy:
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

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

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

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

value: str

The policy which will be applied

class PolicyListResponse:
id: str

Identifier

maxLength32
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

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

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

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

value: str

The policy which will be applied

class PolicyGetResponse:
id: str

Identifier

maxLength32
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

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

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

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

value: str

The policy which will be applied

class PolicyCreateResponse:
id: str

Identifier

maxLength32
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

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

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

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

value: str

The policy which will be applied

class PolicyUpdateResponse:
id: str

Identifier

maxLength32
action: Literal["allow", "log", "add_reporting_directives"]

The action to take if the expression matches

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

A description for the policy

enabled: bool

Whether the policy is enabled

expression: str

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

value: str

The policy which will be applied