Skip to main content

domains

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

Overview

Namedomains
TypeResource
Iddeno.domain.domains

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uuid)The ID of the domain.
certificatesarrayTLS certificates for the domain.
createdAtstring (date-time) (example: 2021-08-01T00:00:00Z)
deploymentIdstringA deployment ID Note that this is not UUID v4, as opposed to organization ID and project ID. (example: abcde12vwxyz)
dnsRecordsarrayThese records are used to verify the ownership of the domain.
domainstringThe domain value. (example: example.com)
isValidatedbooleanWhether the domain's ownership is validated or not.
organizationIdstring (uuid)The ID of the organization that the domain is associated with.
projectIdstring (uuid)The ID of the project that the domain is associated with. If the domain is not associated with any project, this field is omitted.
provisioningStatus
tokenstring (example: b7e28147130005f5593d09e6)
updatedAtstring (date-time) (example: 2021-08-01T00:00:00Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_domainsselectorganizationIdpage, limit, q, sort, orderThis API returns a list of domains belonging to the specified organization
in a pagenated manner.

The URLs for the next, previous, first, and last page are returned in the
Link header of the response, if any.
get_domainselectdomainId
create_domaininsertorganizationId, data__domainThis API allows you to add a new domain to the specified organization.

### Steps to make the added domain available for actual use

In order to make the added domain available for actual use, you first need
to verify that you are the owner of the domain by calling
the verify ownership of a domain endpoint
after properly setting up the DNS records for the domain as specified in the
dnsRecords field of the response of this API.

You then also need to have TLS certificates ready for the domain, either by
enabling auto-provision
or by uploading them manually.
delete_domaindeletedomainId
update_domain_associationexecdomainIdThis API allows you to either:

1. associate a domain with a deployment, or
2. disassociate a domain from a deployment

Domain association is required in order to serve the deployment on the
domain.

If the ownership of the domain is not verified yet, this API will trigger
the verification process before associating the domain with the deployment.

The same functionality is provided by [Attach a domain to a deployment] with
more flexibility. Consider using that API instead.

[Attach a domain to a deployment]: #put-/deployments/-deploymentId-/domains/-domain-
verify_domainexecdomainIdThis API triggers the ownership verification of a domain. It should be
called after necessary DNS records that appear in the dnsRecords field
of the response of add a domain
are set up.

### Domain reactivation

If a previously vefified domain, owned by the same organization, was deleted
and then re-added, deployments associated with the domain will become
accessible via the domain once the verification is successfully completed.

For example, if the domain *.example.com was owned and verified by
example-org and foo.example.com was attached to example-deployment,
the deployment was accessible via foo.example.com. However, if the domain
is deleted from the organization, access to the deployment via
foo.example.com is lost, which we refer to as domain deactivation.

Subsequently, if *.example.com (or even foo.example.com) is re-added to
the organization and verified, the deployment becomes accessible via
foo.example.com again without any further steps, i.e. the domain is
reactivated.

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
domainIdstring (uuid)Domain ID
organizationIdstring (uuid)Organization ID
limitintegerThe maximum number of items to return per page.
orderstringSort order, either asc or desc. Defaults to asc.
pageintegerThe page number to return.
qstringQuery by domain
sortstringThe field to sort by, domain, created_at, or updated_at. Defaults to updated_at.

SELECT examples

This API returns a list of domains belonging to the specified organization
in a pagenated manner.

The URLs for the next, previous, first, and last page are returned in the
Link header of the response, if any.

SELECT
id,
certificates,
createdAt,
deploymentId,
dnsRecords,
domain,
isValidated,
organizationId,
projectId,
provisioningStatus,
token,
updatedAt
FROM deno.domain.domains
WHERE organizationId = '{{ organizationId }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND q = '{{ q }}'
AND sort = '{{ sort }}'
AND order = '{{ order }}'
;

INSERT examples

This API allows you to add a new domain to the specified organization.

### Steps to make the added domain available for actual use

In order to make the added domain available for actual use, you first need
to verify that you are the owner of the domain by calling
the verify ownership of a domain endpoint
after properly setting up the DNS records for the domain as specified in the
dnsRecords field of the response of this API.

You then also need to have TLS certificates ready for the domain, either by
enabling auto-provision
or by uploading them manually.

INSERT INTO deno.domain.domains (
data__domain,
organizationId
)
SELECT
'{{ domain }}' /* required */,
'{{ organizationId }}'
RETURNING
id,
certificates,
createdAt,
deploymentId,
dnsRecords,
domain,
isValidated,
organizationId,
projectId,
provisioningStatus,
token,
updatedAt
;

DELETE examples

No description available.

DELETE FROM deno.domain.domains
WHERE domainId = '{{ domainId }}' --required
;

Lifecycle Methods

This API allows you to either:

1. associate a domain with a deployment, or
2. disassociate a domain from a deployment

Domain association is required in order to serve the deployment on the
domain.

If the ownership of the domain is not verified yet, this API will trigger
the verification process before associating the domain with the deployment.

The same functionality is provided by [Attach a domain to a deployment] with
more flexibility. Consider using that API instead.

[Attach a domain to a deployment]: #put-/deployments/-deploymentId-/domains/-domain-

EXEC deno.domain.domains.update_domain_association 
@domainId='{{ domainId }}' --required
@@json=
'{
"deploymentId": "{{ deploymentId }}"
}'
;