Retrieve project domains by project by id or name
GET
https://api.vercel.com/v9/projects/{idOrName}/domainsRetrieve 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": [ { "apexName": "Example Name", "createdAt": "123", "customEnvironmentId": "example_id", "gitBranch": "string", "name": "Example Name", "projectId": "example_id", "redirect": "string", "redirectStatusCode": "301", "updatedAt": "123", "verification": [ { "domain": "string", "reason": "Customer requested refund", "type": "string", "value": "string" } ], "verified": "false" } ], "pagination": { "count": "123", "next": "123", "prev": "123" }}AuthorizationbearerToken
Default authentication mechanism
Excludes redirect project domains when "false". Includes redirect project domains when "true" (default).