aliases

Assign an Alias

Creates a new alias for the deployment with the given deployment ID. The authenticated user or team must own this deployment. If the desired alias is already assigned to another deployment, then it will be removed from the old deployment and assigned to the new one.

Path Parameters
  • id
    string
    required

    The ID of the deployment the aliases should be listed for

    Exampledpl_FjvFJncQHQcZMznrUm9EoB8sFuPa
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

  • slug
    string

    The Team slug to perform the request on behalf of.

Body
application/json
alias
string

The alias we want to assign to the deployment defined in the URL

Examplemy-alias.vercel.app
redirect
string | null

The redirect property will take precedence over the deployment id from the URL and consists of a hostname (like test.com) to which the alias should redirect using status code 307

Example
Responses
  • 400

    One of the provided values in the request body is invalid. One of the provided values in the request query is invalid. The cert for the provided alias is not ready The deployment is not READY and can not be aliased The supplied alias is invalid

  • 401
  • 402

    The account was soft-blocked for an unhandled reason. The account is missing a payment so payment method must be updated

  • 403

    You do not have permission to access this resource. If no .vercel.app alias exists then we fail (nothing to mirror)

  • 404

    The domain used for the alias was not found The deployment was not found

  • 409

    The provided alias is already assigned to the given deployment The domain is not allowed to be used

POST/v2/deployments/{id}/aliases
fetch('https://api.vercel.com/v2/deployments/{id}/aliases', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    alias: 'my-alias.vercel.app',
    redirect: null
  })
})
{
  "uid": "2WjyKQmM8ZnGcJsPWMrHRHrE",
  "alias": "my-alias.vercel.app",
  "created": "2017-04-26T23:00:34.232Z",
  "oldDeploymentId": "dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa"
}

Delete an Alias

Delete an Alias with the specified ID.

Path Parameters
  • aliasId
    string
    required

    The ID or alias that will be removed

    Example2WjyKQmM8ZnGcJsPWMrHRHrE
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

  • slug
    string

    The Team slug to perform the request on behalf of.

Responses
  • 400

    One of the provided values in the request query is invalid.

  • 401
  • 403

    You do not have permission to access this resource.

  • 404

    The alias was not found

DELETE/v2/aliases/{aliasId}
fetch('https://api.vercel.com/v2/aliases/{aliasId}', {
  method: 'DELETE'
})
{
  "status": "SUCCESS"
}
v0.0.1
OAS 3.0.3

Vercel REST API

The Vercel REST API is a REST-styled API that gives you full control over the entire Vercel platform. You can use it with any programming language or framework that can send HTTP requests. You need to authenticate with a Vercel access token for every request.

Production API

No authentication selected
Client Libraries

aliases

Assign an Alias

Creates a new alias for the deployment with the given deployment ID. The authenticated user or team must own this deployment. If the desired alias is already assigned to another deployment, then it will be removed from the old deployment and assigned to the new one.

Path Parameters
  • id
    string
    required

    The ID of the deployment the aliases should be listed for

    Exampledpl_FjvFJncQHQcZMznrUm9EoB8sFuPa
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

  • slug
    string

    The Team slug to perform the request on behalf of.

Body
application/json
alias
string

The alias we want to assign to the deployment defined in the URL

Examplemy-alias.vercel.app
redirect
string | null

The redirect property will take precedence over the deployment id from the URL and consists of a hostname (like test.com) to which the alias should redirect using status code 307

Example
Responses
  • 400

    One of the provided values in the request body is invalid. One of the provided values in the request query is invalid. The cert for the provided alias is not ready The deployment is not READY and can not be aliased The supplied alias is invalid

  • 401
  • 402

    The account was soft-blocked for an unhandled reason. The account is missing a payment so payment method must be updated

  • 403

    You do not have permission to access this resource. If no .vercel.app alias exists then we fail (nothing to mirror)

  • 404

    The domain used for the alias was not found The deployment was not found

  • 409

    The provided alias is already assigned to the given deployment The domain is not allowed to be used

POST/v2/deployments/{id}/aliases
fetch('https://api.vercel.com/v2/deployments/{id}/aliases', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    alias: 'my-alias.vercel.app',
    redirect: null
  })
})
{
  "uid": "2WjyKQmM8ZnGcJsPWMrHRHrE",
  "alias": "my-alias.vercel.app",
  "created": "2017-04-26T23:00:34.232Z",
  "oldDeploymentId": "dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa"
}

Models