Skip to main content

domains

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

Overview

Namedomains
TypeResource
Idvercel.projects.domains

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestring
apexNamestring
createdAtnumber
gitBranchstring
projectIdstring
redirectstring
redirectStatusCodenumber
updatedAtnumber
verificationarrayA list of verification challenges, one of which must be completed to verify the domain for use on the project. After the challenge is complete POST /projects/:idOrName/domains/:domain/verify to verify the domain. Possible challenges: - If verification.type = TXT the verification.domain will be checked for a TXT record matching verification.value.
verifiedbooleantrue if the domain is verified for use with the project. If false it will not be used as an alias on this project until the challenge in verification is completed.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_project_domainselectidOrName, domain, teamIdGet project domain by project id/name and domain name.
get_project_domainsselectidOrName, teamIdproduction, gitBranch, redirects, redirect, verified, limit, since, until, orderRetrieve the domains associated with a given project by passing either the project id or name in the URL.
remove_project_domaindeleteidOrName, domain, teamIdRemove a domain from a project by passing the domain name and by specifying the project by either passing the project id or name in the URL.
_get_project_domainsexecidOrName, teamIdproduction, gitBranch, redirects, redirect, verified, limit, since, until, orderRetrieve the domains associated with a given project by passing either the project id or name in the URL.
update_project_domainexecidOrName, domain, teamIdUpdate a project domain's configuration, including the name, git branch and redirect of the domain.
add_project_domainexecidOrName, teamId, nameAdd a domain to the project by passing its domain name and by specifying the project by either passing the project id or name in the URL. If the domain is not yet verified to be used on this project, the request will return verified = false, and the domain will need to be verified according to the verification challenge via POST /projects/:idOrName/domains/:domain/verify. If the domain already exists on the project, the request will fail with a 400 status code.
verify_project_domainexecidOrName, domain, teamIdAttempts to verify a project domain with verified = false by checking the correctness of the project domain's verification challenge.

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
domainstringThe domain name you want to verify
idOrNamestringThe unique project identifier or the project name
teamIdstringThe Team identifier or slug to perform the request on behalf of.
gitBranchstringFilters domains based on specific branch.
limitnumberMaximum number of domains to list from a request (max 100).
orderDomains sort order by createdAt
productionFilters only production domains when set to true.
redirectstringFilters domains based on their redirect target.
redirectsExcludes redirect project domains when "false". Includes redirect project domains when "true" (default).
sincenumberGet domains created after this JavaScript timestamp.
untilnumberGet domains created before this JavaScript timestamp.
verifiedFilters domains based on their verification status.

SELECT examples

Get project domain by project id/name and domain name.

SELECT
name,
apexName,
createdAt,
gitBranch,
projectId,
redirect,
redirectStatusCode,
updatedAt,
verification,
verified
FROM vercel.projects.domains
WHERE idOrName = '{{ idOrName }}' -- required
AND domain = '{{ domain }}' -- required
AND teamId = '{{ teamId }}' -- required
;

DELETE examples

Remove a domain from a project by passing the domain name and by specifying the project by either passing the project id or name in the URL.

DELETE FROM vercel.projects.domains
WHERE idOrName = '{{ idOrName }}' --required
AND domain = '{{ domain }}' --required
AND teamId = '{{ teamId }}' --required
;

Lifecycle Methods

Retrieve the domains associated with a given project by passing either the project id or name in the URL.

EXEC vercel.projects.domains._get_project_domains 
@idOrName='{{ idOrName }}' --required,
@teamId='{{ teamId }}' --required,
@production='{{ production }}',
@gitBranch='{{ gitBranch }}',
@redirects='{{ redirects }}',
@redirect='{{ redirect }}',
@verified='{{ verified }}',
@limit='{{ limit }}',
@since='{{ since }}',
@until='{{ until }}',
@order='{{ order }}'
;