Skip to content
Start here

Policies

List Page Shield policies
client.PageShield.Policies.List(ctx, query) (*SinglePage[PolicyListResponse], error)
GET/zones/{zone_id}/page_shield/policies
Get a Page Shield policy
client.PageShield.Policies.Get(ctx, policyID, query) (*PolicyGetResponse, error)
GET/zones/{zone_id}/page_shield/policies/{policy_id}
Create a Page Shield policy
client.PageShield.Policies.New(ctx, params) (*PolicyNewResponse, error)
POST/zones/{zone_id}/page_shield/policies
Update a Page Shield policy
client.PageShield.Policies.Update(ctx, policyID, params) (*PolicyUpdateResponse, error)
PUT/zones/{zone_id}/page_shield/policies/{policy_id}
Delete a Page Shield policy
client.PageShield.Policies.Delete(ctx, policyID, body) error
DELETE/zones/{zone_id}/page_shield/policies/{policy_id}
ModelsExpand Collapse
type Policy struct{…}
Action PolicyAction

The action to take if the expression matches

One of the following:
const PolicyActionAllow PolicyAction = "allow"
const PolicyActionLog PolicyAction = "log"
const PolicyActionAddReportingDirectives PolicyAction = "add_reporting_directives"
Description string

A description for the policy

Enabled bool

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