custom_pages
Creates, updates, deletes, gets or lists a custom_pages resource.
Overview
| Name | custom_pages |
| Type | Resource |
| Id | cloudflare.zero_trust.custom_pages |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get a custom page response
| Name | Datatype | Description |
|---|---|---|
name | string | Custom page name. |
app_count | integer | Number of apps the custom page is assigned to. |
created_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
custom_html | string | Custom page HTML. (example: <html><body><h1>Access Denied</h1></body></html>) |
type | string | Custom page type. (identity_denied, forbidden) |
uid | string | UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
updated_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
List custom pages response
| Name | Datatype | Description |
|---|---|---|
name | string | Custom page name. |
app_count | integer | Number of apps the custom page is assigned to. |
created_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
type | string | Custom page type. (identity_denied, forbidden) |
uid | string | UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
updated_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | custom_page_id, account_id | Fetches a custom page and also returns its HTML. | |
list | select | account_id | page, per_page | List custom pages |
create | insert | account_id, name, custom_html, type | Create a custom page | |
update | replace | custom_page_id, account_id, name, custom_html, type | Update a custom page | |
delete | delete | custom_page_id, account_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
custom_page_id | string | |
page | integer | |
per_page | integer |
SELECT examples
- get
- list
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
;
List custom pages
SELECT
name,
app_count,
created_at,
type,
uid,
updated_at
FROM cloudflare.zero_trust.custom_pages
WHERE account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: custom_pages
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the custom_pages resource.
- name: app_count
value: {{ app_count }}
description: |
Number of apps the custom page is assigned to.
- name: custom_html
value: "{{ custom_html }}"
description: |
Custom page HTML.
- name: name
value: "{{ name }}"
description: |
Custom page name.
- name: type
value: "{{ type }}"
description: |
Custom page type.
valid_values: ['identity_denied', 'forbidden']
REPLACE examples
- update
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
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
;