GET
/
v9
/
projects
/
{idOrName}
/
domains
import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.projects.getProjectDomains({
    idOrName: "<value>",
    customEnvironmentId: "env_123abc4567",
    redirect: "example.com",
    limit: 20,
    since: 1609499532000,
    until: 1612264332000,
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  // Handle the result
  console.log(result);
}

run();
{
  "domains": [
    {
      "name": "<string>",
      "apexName": "<string>",
      "projectId": "<string>",
      "redirect": "<string>",
      "redirectStatusCode": 307,
      "gitBranch": "<string>",
      "customEnvironmentId": "<string>",
      "updatedAt": 123,
      "createdAt": 123,
      "verified": true,
      "verification": [
        {
          "type": "<string>",
          "domain": "<string>",
          "value": "<string>",
          "reason": "<string>"
        }
      ]
    }
  ],
  "pagination": {
    "count": 20,
    "next": 1540095775951,
    "prev": 1540095775951
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Path Parameters

idOrName
string
required

The unique project identifier or the project name

Query Parameters

production
enum<string>
default:false

Filters only production domains when set to true.

Available options:
true,
false
target
enum<string>

Filters on the target of the domain. Can be either "production", "preview"

Available options:
production,
preview
customEnvironmentId
string

The unique custom environment identifier within the project

Example:

"env_123abc4567"

gitBranch
string

Filters domains based on specific branch.

redirects
enum<string>
default:true

Excludes redirect project domains when "false". Includes redirect project domains when "true" (default).

Available options:
true,
false
redirect
string

Filters domains based on their redirect target.

Example:

"example.com"

verified
enum<string>

Filters domains based on their verification status.

Available options:
true,
false
limit
number

Maximum number of domains to list from a request (max 100).

Example:

20

since
number

Get domains created after this JavaScript timestamp.

Example:

1609499532000

until
number

Get domains created before this JavaScript timestamp.

Example:

1612264332000

order
enum<string>
default:DESC

Domains sort order by createdAt

Available options:
ASC,
DESC
teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Response

200
application/json
Successful response retrieving a list of domains
domains
object[]
required
pagination
object
required

This object contains information related to the pagination of the current request, including the necessary parameters to get the next or previous page of data.