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.
- idstringrequired
The ID of the deployment the aliases should be listed for
Exampledpl_FjvFJncQHQcZMznrUm9EoB8sFuPa
- teamIdstring
The Team identifier to perform the request on behalf of.
- slugstring
The Team slug to perform the request on behalf of.
The alias we want to assign to the deployment defined in the URL
my-alias.vercel.app
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
- 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
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"
}
The alias was successfully assigned to the deployment
Delete an Alias
Delete an Alias with the specified ID.
- aliasIdstringrequired
The ID or alias that will be removed
Example2WjyKQmM8ZnGcJsPWMrHRHrE
- teamIdstring
The Team identifier to perform the request on behalf of.
- slugstring
The Team slug to perform the request on behalf of.
- 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
fetch('https://api.vercel.com/v2/aliases/{aliasId}', {
method: 'DELETE'
})
{
"status": "SUCCESS"
}
The alias was successfully removed
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
access-groups
- POST/v1/access-groups/{accessGroupIdOrName}/projects
- POST/v1/access-groups
- DELETE/v1/access-groups/{accessGroupIdOrName}/projects/{projectId}
- DELETE/v1/access-groups/{idOrName}
- GET/v1/access-groups
- GET/v1/access-groups/{idOrName}/members
- GET/v1/access-groups/{idOrName}/projects
- GET/v1/access-groups/{idOrName}
- GET/v1/access-groups/{accessGroupIdOrName}/projects/{projectId}
- POST/v1/access-groups/{idOrName}
- PATCH/v1/access-groups/{accessGroupIdOrName}/projects/{projectId}
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.
- idstringrequired
The ID of the deployment the aliases should be listed for
Exampledpl_FjvFJncQHQcZMznrUm9EoB8sFuPa
- teamIdstring
The Team identifier to perform the request on behalf of.
- slugstring
The Team slug to perform the request on behalf of.
The alias we want to assign to the deployment defined in the URL
my-alias.vercel.app
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
- 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
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"
}
The alias was successfully assigned to the deployment