domains
Creates, updates, deletes, gets or lists a domains
resource.
Overview
Name | domains |
Type | Resource |
Id | vercel.projects.domains |
Fields
The following fields are returned by SELECT
queries:
- get_project_domain
- get_project_domains
Name | Datatype | Description |
---|---|---|
name | string | |
apexName | string | |
createdAt | number | |
gitBranch | string | |
projectId | string | |
redirect | string | |
redirectStatusCode | number | |
updatedAt | number | |
verification | array | A 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 . |
verified | boolean | true 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. |
Successful response retrieving a list of domains
Name | Datatype | Description |
---|---|---|
name | string | |
apexName | string | |
createdAt | number | |
gitBranch | string | |
projectId | string | |
redirect | string | |
redirectStatusCode | number | |
updatedAt | number | |
verification | array | A 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 . |
verified | boolean | true 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_project_domain | select | idOrName , domain , teamId | Get project domain by project id/name and domain name. | |
get_project_domains | select | idOrName , teamId | production , gitBranch , redirects , redirect , verified , limit , since , until , order | Retrieve the domains associated with a given project by passing either the project id or name in the URL. |
remove_project_domain | delete | idOrName , domain , teamId | 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. | |
_get_project_domains | exec | idOrName , teamId | production , gitBranch , redirects , redirect , verified , limit , since , until , order | Retrieve the domains associated with a given project by passing either the project id or name in the URL. |
update_project_domain | exec | idOrName , domain , teamId | Update a project domain's configuration, including the name, git branch and redirect of the domain. | |
add_project_domain | exec | idOrName , teamId , name | Add 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_domain | exec | idOrName , domain , teamId | Attempts 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.
Name | Datatype | Description |
---|---|---|
domain | string | The domain name you want to verify |
idOrName | string | The unique project identifier or the project name |
teamId | string | The Team identifier or slug to perform the request on behalf of. |
gitBranch | string | Filters domains based on specific branch. |
limit | number | Maximum number of domains to list from a request (max 100). |
order |
| Domains sort order by createdAt |
production |
| Filters only production domains when set to true . |
redirect | string | Filters domains based on their redirect target. |
redirects |
| Excludes redirect project domains when "false". Includes redirect project domains when "true" (default). |
since | number | Get domains created after this JavaScript timestamp. |
until | number | Get domains created before this JavaScript timestamp. |
verified |
| Filters domains based on their verification status. |
SELECT
examples
- get_project_domain
- get_project_domains
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
;
Retrieve the domains associated with a given project by passing either the project id
or name
in the URL.
SELECT
name,
apexName,
createdAt,
gitBranch,
projectId,
redirect,
redirectStatusCode,
updatedAt,
verification,
verified
FROM vercel.projects.domains
WHERE idOrName = '{{ idOrName }}' -- required
AND teamId = '{{ teamId }}' -- required
AND production = '{{ production }}'
AND gitBranch = '{{ gitBranch }}'
AND redirects = '{{ redirects }}'
AND redirect = '{{ redirect }}'
AND verified = '{{ verified }}'
AND limit = '{{ limit }}'
AND since = '{{ since }}'
AND until = '{{ until }}'
AND order = '{{ order }}'
;
DELETE
examples
- remove_project_domain
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
- _get_project_domains
- update_project_domain
- add_project_domain
- verify_project_domain
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 }}'
;
Update a project domain's configuration, including the name, git branch and redirect of the domain.
EXEC vercel.projects.domains.update_project_domain
@idOrName='{{ idOrName }}' --required,
@domain='{{ domain }}' --required,
@teamId='{{ teamId }}' --required
@@json=
'{
"gitBranch": "{{ gitBranch }}",
"redirect": "{{ redirect }}",
"redirectStatusCode": {{ redirectStatusCode }}
}'
;
Add 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.
EXEC vercel.projects.domains.add_project_domain
@idOrName='{{ idOrName }}' --required,
@teamId='{{ teamId }}' --required
@@json=
'{
"name": "{{ name }}",
"gitBranch": "{{ gitBranch }}",
"redirect": "{{ redirect }}",
"redirectStatusCode": {{ redirectStatusCode }}
}'
;
Attempts to verify a project domain with verified = false
by checking the correctness of the project domain's verification
challenge.
EXEC vercel.projects.domains.verify_project_domain
@idOrName='{{ idOrName }}' --required,
@domain='{{ domain }}' --required,
@teamId='{{ teamId }}' --required
;