Skip to main content

domains

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

Overview

Namedomains
TypeResource
Idcloudflare.pages.domains

Fields

The following fields are returned by SELECT queries:

Get domain response.

NameDatatypeDescription
idstring
namestringThe domain name. (example: this-is-my-domain-01.com)
domain_idstring
certificate_authoritystring (google, lets_encrypt) (example: lets_encrypt)
created_onstring
statusstring (initializing, pending, active, deactivated, blocked, error)
validation_dataobject
verification_dataobject
zone_tagstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdomain_name, project_name, account_idFetch a single domain.
listselectproject_name, account_idFetch a list of all domains associated with a Pages project.
createinsertproject_name, account_id, nameAdd a new domain for the Pages project.
editupdatedomain_name, project_name, account_idRetry the validation status of a single domain.
deletedeletedomain_name, project_name, account_idDelete a Pages project's domain.

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.
domain_namestring
project_namestringThe Pages project name.

SELECT examples

Fetch a single domain.

SELECT
id,
name,
domain_id,
certificate_authority,
created_on,
status,
validation_data,
verification_data,
zone_tag
FROM cloudflare.pages.domains
WHERE domain_name = '{{ domain_name }}' -- required
AND project_name = '{{ project_name }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Add a new domain for the Pages project.

INSERT INTO cloudflare.pages.domains (
name,
project_name,
account_id
)
SELECT
'{{ name }}' /* required */,
'{{ project_name }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Retry the validation status of a single domain.

UPDATE cloudflare.pages.domains
SET
-- No updatable properties
WHERE
domain_name = '{{ domain_name }}' --required
AND project_name = '{{ project_name }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Delete a Pages project's domain.

DELETE FROM cloudflare.pages.domains
WHERE domain_name = '{{ domain_name }}' --required
AND project_name = '{{ project_name }}' --required
AND account_id = '{{ account_id }}' --required
;