Skip to main content

subdomains

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

Overview

Namesubdomains
TypeResource
Idcloudflare.workers.subdomains

Fields

The following fields are returned by SELECT queries:

Get Subdomain response.

NameDatatypeDescription
subdomainstring (example: my-subdomain)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_idReturns a Workers subdomain for an account.
updatereplaceaccount_id, subdomainCreates a Workers subdomain for an account.
deletedeleteaccount_idDeletes a Workers subdomain for an account.

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.

SELECT examples

Returns a Workers subdomain for an account.

SELECT
subdomain
FROM cloudflare.workers.subdomains
WHERE account_id = '{{ account_id }}' -- required
;

REPLACE examples

Creates a Workers subdomain for an account.

REPLACE cloudflare.workers.subdomains
SET
subdomain = '{{ subdomain }}'
WHERE
account_id = '{{ account_id }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Deletes a Workers subdomain for an account.

DELETE FROM cloudflare.workers.subdomains
WHERE account_id = '{{ account_id }}' --required
;