Skip to content
Start here

Page Shield

Get client-side security settings
client.pageShield.get(PageShieldGetParams { zone_id } params, RequestOptionsoptions?): PageShieldGetResponse { enabled, updated_at, use_cloudflare_reporting_endpoint, use_connection_url_path } | null
GET/zones/{zone_id}/page_shield
Update client-side security settings
client.pageShield.update(PageShieldUpdateParams { zone_id, enabled, use_cloudflare_reporting_endpoint, use_connection_url_path } params, RequestOptionsoptions?): PageShieldUpdateResponse { enabled, updated_at, use_cloudflare_reporting_endpoint, use_connection_url_path }
PUT/zones/{zone_id}/page_shield
ModelsExpand Collapse
PageShieldGetResponse { enabled, updated_at, use_cloudflare_reporting_endpoint, use_connection_url_path }
enabled: boolean

When true, indicates that Client-Side Security is enabled.

updated_at: string

The timestamp of when Client-Side Security was last updated.

use_cloudflare_reporting_endpoint: boolean
use_connection_url_path: boolean

When true, the paths associated with connections URLs will also be analyzed.

PageShieldUpdateResponse { enabled, updated_at, use_cloudflare_reporting_endpoint, use_connection_url_path }
enabled: boolean

When true, indicates that Client-Side Security is enabled.

updated_at: string

The timestamp of when Client-Side Security was last updated.

use_cloudflare_reporting_endpoint: boolean
use_connection_url_path: boolean

When true, the paths associated with connections URLs will also be analyzed.

Page ShieldPolicies

List content security rules
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 content security rule
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 content security rule
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 content security rule
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 content security rule
client.pageShield.policies.delete(stringpolicyID, PolicyDeleteParams { zone_id } params, RequestOptionsoptions?): void
DELETE/zones/{zone_id}/page_shield/policies/{policy_id}
ModelsExpand Collapse
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

Page ShieldConnections

List detected connections
client.pageShield.connections.list(ConnectionListParams { zone_id, direction, exclude_cdn_cgi, 10 more } params, RequestOptionsoptions?): SinglePage<ConnectionListResponse { id, added_at, first_seen_at, 10 more } >
GET/zones/{zone_id}/page_shield/connections
Get a detected connection
client.pageShield.connections.get(stringconnectionID, ConnectionGetParams { zone_id } params, RequestOptionsoptions?): ConnectionGetResponse { id, added_at, first_seen_at, 10 more } | null
GET/zones/{zone_id}/page_shield/connections/{connection_id}
ModelsExpand Collapse
ConnectionListResponse { id, added_at, first_seen_at, 10 more }
id: string

Identifier

maxLength32
added_at: string
formatdate-time
first_seen_at: string
formatdate-time
host: string
last_seen_at: string
formatdate-time
url: string
url_contains_cdn_cgi_path: boolean
domain_reported_malicious?: boolean
first_page_url?: string
malicious_domain_categories?: Array<string>
malicious_url_categories?: Array<string>
page_urls?: Array<string>
url_reported_malicious?: boolean
ConnectionGetResponse { id, added_at, first_seen_at, 10 more }
id: string

Identifier

maxLength32
added_at: string
formatdate-time
first_seen_at: string
formatdate-time
host: string
last_seen_at: string
formatdate-time
url: string
url_contains_cdn_cgi_path: boolean
domain_reported_malicious?: boolean
first_page_url?: string
malicious_domain_categories?: Array<string>
malicious_url_categories?: Array<string>
page_urls?: Array<string>
url_reported_malicious?: boolean

Page ShieldScripts

List detected scripts
client.pageShield.scripts.list(ScriptListParams { zone_id, direction, exclude_cdn_cgi, 11 more } params, RequestOptionsoptions?): SinglePage<ScriptListResponse { id, added_at, first_seen_at, 18 more } >
GET/zones/{zone_id}/page_shield/scripts
Get a detected script
client.pageShield.scripts.get(stringscriptID, ScriptGetParams { zone_id } params, RequestOptionsoptions?): ScriptGetResponse { id, added_at, first_seen_at, 19 more } | null
GET/zones/{zone_id}/page_shield/scripts/{script_id}
ModelsExpand Collapse
ScriptListResponse { id, added_at, first_seen_at, 18 more }
id: string

Identifier

maxLength32
added_at: string
formatdate-time
first_seen_at: string
formatdate-time
host: string
last_seen_at: string
formatdate-time
url: string
url_contains_cdn_cgi_path: boolean
cryptomining_score?: number | null

The cryptomining score of the JavaScript content.

maximum99
minimum1
Deprecateddataflow_score?: number | null

The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
domain_reported_malicious?: boolean
fetched_at?: string | null

The timestamp of when the script was last fetched.

first_page_url?: string
hash?: string | null

The computed hash of the analyzed script.

maxLength64
minLength64
js_integrity_score?: number | null

The integrity score of the JavaScript content.

maximum99
minimum1
magecart_score?: number | null

The magecart score of the JavaScript content.

maximum99
minimum1
malicious_domain_categories?: Array<string>
malicious_url_categories?: Array<string>
malware_score?: number | null

The malware score of the JavaScript content.

maximum99
minimum1
Deprecatedobfuscation_score?: number | null

The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
page_urls?: Array<string>
url_reported_malicious?: boolean
ScriptGetResponse { id, added_at, first_seen_at, 19 more }
id: string

Identifier

maxLength32
added_at: string
formatdate-time
first_seen_at: string
formatdate-time
host: string
last_seen_at: string
formatdate-time
url: string
url_contains_cdn_cgi_path: boolean
cryptomining_score?: number | null

The cryptomining score of the JavaScript content.

maximum99
minimum1
Deprecateddataflow_score?: number | null

The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
domain_reported_malicious?: boolean
fetched_at?: string | null

The timestamp of when the script was last fetched.

first_page_url?: string
hash?: string | null

The computed hash of the analyzed script.

maxLength64
minLength64
js_integrity_score?: number | null

The integrity score of the JavaScript content.

maximum99
minimum1
magecart_score?: number | null

The magecart score of the JavaScript content.

maximum99
minimum1
malicious_domain_categories?: Array<string>
malicious_url_categories?: Array<string>
malware_score?: number | null

The malware score of the JavaScript content.

maximum99
minimum1
Deprecatedobfuscation_score?: number | null

The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
page_urls?: Array<string>
url_reported_malicious?: boolean
versions?: Array<Version> | null
cryptomining_score?: number | null

The cryptomining score of the JavaScript content.

maximum99
minimum1
Deprecateddataflow_score?: number | null

The dataflow score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1
fetched_at?: string | null

The timestamp of when the script was last fetched.

hash?: string | null

The computed hash of the analyzed script.

maxLength64
minLength64
js_integrity_score?: number | null

The integrity score of the JavaScript content.

maximum99
minimum1
magecart_score?: number | null

The magecart score of the JavaScript content.

maximum99
minimum1
malware_score?: number | null

The malware score of the JavaScript content.

maximum99
minimum1
Deprecatedobfuscation_score?: number | null

The obfuscation score of the JavaScript content. This field has been deprecated in favour of js_integrity_score.

maximum99
minimum1

Page ShieldCookies

List detected cookies
client.pageShield.cookies.list(CookieListParams { zone_id, direction, domain, 12 more } params, RequestOptionsoptions?): SinglePage<CookieListResponse { id, first_seen_at, host, 11 more } >
GET/zones/{zone_id}/page_shield/cookies
Get a detected cookie
client.pageShield.cookies.get(stringcookieID, CookieGetParams { zone_id } params, RequestOptionsoptions?): CookieGetResponse { id, first_seen_at, host, 11 more } | null
GET/zones/{zone_id}/page_shield/cookies/{cookie_id}
ModelsExpand Collapse
One of the following:
One of the following:
One of the following:
One of the following: