VercelVercel
Menu

Retrieve project domains by project by id or name

GEThttps://api.vercel.com/v9/projects/{idOrName}/domains
Retrieve the domains associated with a given project by passing either the project id or name in the URL.
https://api.vercel.com/v9/projects/{idOrName}/domains
const response = await fetch('https://api.vercel.com/v9/projects/idOrName/domains?production=value&target=string&customEnvironmentId=string&gitBranch=string&redirects=value&redirect=string&verified=value&limit=123&since=123&until=123&order=value&teamId=string&slug=string', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
Response
{
"domains": [
{
"name": "Example Name",
"apexName": "Example Name",
"projectId": "example_id",
"redirect": "string",
"redirectStatusCode": "301",
"gitBranch": "string",
"customEnvironmentId": "example_id",
"updatedAt": "123",
"createdAt": "123",
"verified": "false",
"verification": [
{
"type": "string",
"domain": "string",
"value": "string",
"reason": "Customer requested refund"
}
]
}
],
"pagination": {
"count": "123",
"next": "123",
"prev": "123"
}
}
AuthorizationbearerToken

Default authentication mechanism

idOrNameanyRequired
The unique project identifier or the project name
productionanyOptional
Filters only production domains when set to true.
targetstringOptional
Filters on the target of the domain. Can be either "production", "preview"
customEnvironmentIdstringOptional
The unique custom environment identifier within the project
gitBranchstringOptional
Filters domains based on specific branch.
redirectsanyOptional
Excludes redirect project domains when "false". Includes redirect project domains when "true" (default).
redirectstringOptional
Filters domains based on their redirect target.
verifiedanyOptional
Filters domains based on their verification status.
limitnumberOptional
Maximum number of domains to list from a request (max 100).
sincenumberOptional
Get domains created after this JavaScript timestamp.
untilnumberOptional
Get domains created before this JavaScript timestamp.
orderanyOptional
Domains sort order by createdAt
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Successful response retrieving a list of domains
domainsarrayRequired
paginationobjectRequired
400One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.