Skip to main content

custom_pages

Creates, updates, deletes, gets or lists a custom_pages resource.

Overview

Namecustom_pages
TypeResource
Idcloudflare.zero_trust.custom_pages

Fields

The following fields are returned by SELECT queries:

Get a custom page response

NameDatatypeDescription
namestringCustom page name.
app_countintegerNumber of apps the custom page is assigned to.
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
custom_htmlstringCustom page HTML. (example: <html><body><h1>Access Denied</h1></body></html>)
typestringCustom page type. (identity_denied, forbidden)
uidstringUUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415)
updated_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcustom_page_id, account_idFetches a custom page and also returns its HTML.
listselectaccount_idpage, per_pageList custom pages
createinsertaccount_id, name, custom_html, typeCreate a custom page
updatereplacecustom_page_id, account_id, name, custom_html, typeUpdate a custom page
deletedeletecustom_page_id, account_idDelete a custom page

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
custom_page_idstring
pageinteger
per_pageinteger

SELECT examples

Fetches a custom page and also returns its HTML.

SELECT
name,
app_count,
created_at,
custom_html,
type,
uid,
updated_at
FROM cloudflare.zero_trust.custom_pages
WHERE custom_page_id = '{{ custom_page_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Create a custom page

INSERT INTO cloudflare.zero_trust.custom_pages (
app_count,
custom_html,
name,
type,
account_id
)
SELECT
{{ app_count }},
'{{ custom_html }}' /* required */,
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Update a custom page

REPLACE cloudflare.zero_trust.custom_pages
SET
app_count = {{ app_count }},
custom_html = '{{ custom_html }}',
name = '{{ name }}',
type = '{{ type }}'
WHERE
custom_page_id = '{{ custom_page_id }}' --required
AND account_id = '{{ account_id }}' --required
AND name = '{{ name }}' --required
AND custom_html = '{{ custom_html }}' --required
AND type = '{{ type }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Delete a custom page

DELETE FROM cloudflare.zero_trust.custom_pages
WHERE custom_page_id = '{{ custom_page_id }}' --required
AND account_id = '{{ account_id }}' --required
;