Page Shield

page_shield

Methods

Get Page Shield Settings -> Envelope<>
get/zones/{zone_id}/page_shield

Fetches the Page Shield settings.

Update Page Shield Settings -> Envelope<{ enabled, updated_at, use_cloudflare_reporting_endpoint, 1 more... }>
put/zones/{zone_id}/page_shield

Updates Page Shield settings.

Domain types

Setting = { enabled, updated_at, use_cloudflare_reporting_endpoint, 1 more... }
Page Shield

Connections

page_shield.connections

Methods

Get A Page Shield Connection -> Envelope<>
get/zones/{zone_id}/page_shield/connections/{connection_id}

Fetches a connection detected by Page Shield by connection ID.

List Page Shield Connections -> SinglePage<>
get/zones/{zone_id}/page_shield/connections

Lists all connections detected by Page Shield.

Domain types

Connection = { id, added_at, first_seen_at, 10 more... }

page_shield.cookies

Methods

Get A Page Shield Cookie -> Envelope<{ id, first_seen_at, host, 11 more... }>
get/zones/{zone_id}/page_shield/cookies/{cookie_id}

Fetches a cookie collected by Page Shield by cookie ID.

List Page Shield Cookies -> SinglePage<{ id, first_seen_at, host, 11 more... }>
get/zones/{zone_id}/page_shield/cookies

Lists all cookies collected by Page Shield.

Page Shield

Policies

page_shield.policies

Methods

Create A Page Shield Policy -> Envelope<{ id, action, description, 3 more... }>
post/zones/{zone_id}/page_shield/policies

Create a Page Shield policy.

Delete A Page Shield Policy ->
delete/zones/{zone_id}/page_shield/policies/{policy_id}

Delete a Page Shield policy by ID.

Get A Page Shield Policy -> Envelope<{ id, action, description, 3 more... }>
get/zones/{zone_id}/page_shield/policies/{policy_id}

Fetches a Page Shield policy by ID.

List Page Shield Policies -> SinglePage<{ id, action, description, 3 more... }>
get/zones/{zone_id}/page_shield/policies

Lists all Page Shield policies.

Update A Page Shield Policy -> Envelope<{ id, action, description, 3 more... }>
put/zones/{zone_id}/page_shield/policies/{policy_id}

Update a Page Shield policy by ID.

Domain types

Policy = { action, description, enabled, 2 more... }

page_shield.scripts

Methods

Get A Page Shield Script -> Envelope<{ id, added_at, first_seen_at, 19 more... }>
get/zones/{zone_id}/page_shield/scripts/{script_id}

Fetches a script detected by Page Shield by script ID.

List Page Shield Scripts -> SinglePage<>
get/zones/{zone_id}/page_shield/scripts

Lists all scripts detected by Page Shield.

Security
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example: X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example: X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194

Accepted Permissions (at least one required)

Page Shield Domain Page Shield Read Domain Page Shield Page Shield Read Zone Settings Write Zone Settings Read

Parameters
zone_id: string
(maxLength: 32)

Identifier

direction:
Optional

The direction used to sort returned scripts.

"asc"
"desc"
exclude_cdn_cgi: boolean
Optional

When true, excludes scripts seen in a /cdn-cgi path from the returned scripts. The default value is true.

exclude_duplicates: boolean
Optional

When true, excludes duplicate scripts. We consider a script duplicate of another if their javascript content matches and they share the same url host and zone hostname. In such case, we return the most recent script for the URL host and zone hostname combination.

exclude_urls: string
Optional

Excludes scripts whose URL contains one of the URL-encoded URLs separated by commas.

export:
Optional

Export the list of scripts as a file.

"csv"
hosts: string
Optional

Includes scripts that match one or more URL-encoded hostnames separated by commas.

Wildcards are supported at the start and end of each hostname to support starts with, ends with and contains. If no wildcards are used, results will be filtered by exact match

order_by:
Optional

The field used to sort returned scripts.

"first_seen_at"
"last_seen_at"
page: string
Optional

The current page number of the paginated results.

We additionally support a special value "all". When "all" is used, the API will return all the scripts with the applied filters in a single page. This feature is best-effort and it may only work for zones with a low number of scripts

page_url: string
Optional

Includes scripts that match one or more page URLs (separated by commas) where they were last seen

Wildcards are supported at the start and end of each page URL to support starts with, ends with and contains. If no wildcards are used, results will be filtered by exact match

per_page: number
Optional
(maximum: 100, minimum: 1)

The number of results per page.

prioritize_malicious: boolean
Optional

When true, malicious scripts appear first in the returned scripts.

status: string
Optional

Filters the returned scripts using a comma-separated list of scripts statuses. Accepted values: active, infrequent, and inactive. The default value is active.

urls: string
Optional

Includes scripts whose URL contain one or more URL-encoded URLs separated by commas.

Response fields
result: Array<>
result_info: { count, page, per_page, 2 more... }
success: true

Whether the API call was successful

errors: Array<>
Optional
messages: Array<>
Optional
Request example
200Example

Domain types

Script = { id, added_at, first_seen_at, 18 more... }