GET
/
v4
/
aliases
/
{idOrAlias}
getAlias
import { Vercel } from "@vercel/sdk";

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

async function run() {
  const result = await vercel.aliases.getAlias({
    from: 1540095775951,
    idOrAlias: "example.vercel.app",
    projectId: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
    since: 1540095775941,
    until: 1540095775951,
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();
[
  {
    "alias": "my-alias.vercel.app",
    "created": "2017-04-26T23:00:34.232Z",
    "createdAt": 1540095775941,
    "creator": {
      "uid": "96SnxkFiMyVKsK3pnoHfx3Hz",
      "email": "john-doe@gmail.com",
      "username": "john-doe"
    },
    "deletedAt": 1540095775941,
    "deployment": {
      "id": "dpl_5m8CQaRBm3FnWRW1od3wKTpaECPx",
      "url": "my-instant-deployment-3ij3cxz9qr.now.sh",
      "meta": {}
    },
    "deploymentId": "dpl_5m8CQaRBm3FnWRW1od3wKTpaECPx",
    "projectId": "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
    "redirect": "<string>",
    "redirectStatusCode": 301,
    "uid": "<string>",
    "updatedAt": 1540095775941,
    "protectionBypass": {},
    "microfrontends": {
      "defaultApp": {
        "projectId": "<string>"
      },
      "applications": [
        {
          "fallbackHost": "<string>",
          "projectId": "<string>"
        }
      ]
    }
  }
]

Authorizations

Authorization
string
header
required

Default authentication mechanism

Path Parameters

idOrAlias
string
required

The alias or alias ID to be retrieved

Example:

"example.vercel.app"

Query Parameters

from
number
deprecated

Get the alias only if it was created after the provided timestamp

Example:

1540095775951

projectId
string

Get the alias only if it is assigned to the provided project ID

Example:

"prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB"

since
number

Get the alias only if it was created after this JavaScript timestamp

Example:

1540095775941

until
number

Get the alias only if it was created before this JavaScript timestamp

Example:

1540095775951

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

The alias information

alias
string
required

The alias name, it could be a .vercel.app subdomain or a custom domain

Example:

"my-alias.vercel.app"

created
string<date-time>
required

The date when the alias was created

Example:

"2017-04-26T23:00:34.232Z"

deploymentId
string | null
required

The deployment ID

Example:

"dpl_5m8CQaRBm3FnWRW1od3wKTpaECPx"

projectId
string | null
required

The unique identifier of the project

Example:

"prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB"

uid
string
required

The unique identifier of the alias

createdAt
number

The date when the alias was created in milliseconds since the UNIX epoch

Example:

1540095775941

creator
object

Information of the user who created the alias

deletedAt
number

The date when the alias was deleted in milliseconds since the UNIX epoch

Example:

1540095775941

deployment
object

A map with the deployment ID, URL and metadata

redirect
string | null

Target destination domain for redirect when the alias is a redirect

redirectStatusCode
enum<number> | null

Status code to be used on redirect

Available options:
301,
302,
307,
308
updatedAt
number

The date when the alias was updated in milliseconds since the UNIX epoch

Example:

1540095775941

protectionBypass
object

The protection bypass for the alias

microfrontends
object

The microfrontends for the alias including the routing configuration