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.
Optional params
fetch-request
1await fetch("https://api.vercel.com/v2/deployments/dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa/aliases?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {2 "body": {3 "alias": "my-alias.vercel.app",4 "redirect": "SOME_STRING_VALUE"5 },6 "headers": {7 "Authorization": "Bearer <TOKEN>"8 },9 "method": "post"10})
Path Parameter | Description |
---|---|
id | string of the following requiredThe ID of the deployment the aliases should be listed for Example: dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa type: string |
aliasstringRequired The assigned alias name Example:
my-alias.vercel.app
createdstring (date-time)Required The date when the alias was created Example:
2017-04-26T23:00:34.232Z
oldDeploymentIdstring or null The unique identifier of the previously aliased deployment, only received when the alias was used before Example:
dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa
uidstringRequired The unique identifier of the alias Example:
2WjyKQmM8ZnGcJsPWMrHRHrE
Code | Description |
---|---|
200 | The alias was successfully assigned to the deployment |
400 |
|
401 | |
402 |
|
403 |
|
404 |
|
409 |
|
Optional params
fetch-request
1await fetch("https://api.vercel.com/v2/deployments/dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa/aliases?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {2 "body": {3 "alias": "my-alias.vercel.app",4 "redirect": "SOME_STRING_VALUE"5 },6 "headers": {7 "Authorization": "Bearer <TOKEN>"8 },9 "method": "post"10})
Delete an Alias with the specified ID.
Optional params
fetch-request
1await fetch("https://api.vercel.com/v2/aliases/2WjyKQmM8ZnGcJsPWMrHRHrE?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {2 "headers": {3 "Authorization": "Bearer <TOKEN>"4 },5 "method": "delete"6})
Path Parameter | Description |
---|---|
aliasId | string of the following requiredThe ID or alias that will be removed Example: 2WjyKQmM8ZnGcJsPWMrHRHrE type: string |
statusstringRequired One of: SUCCESS
Code | Description |
---|---|
200 | The alias was successfully removed |
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 |
Optional params
fetch-request
1await fetch("https://api.vercel.com/v2/aliases/2WjyKQmM8ZnGcJsPWMrHRHrE?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {2 "headers": {3 "Authorization": "Bearer <TOKEN>"4 },5 "method": "delete"6})
Retrieves an Alias for the given host name or alias ID.
Optional params
fetch-request
1await fetch("https://api.vercel.com/v4/aliases/example.vercel.app?from=1540095775951&projectId=prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB&since=1540095775941&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE&until=1540095775951", {2 "headers": {3 "Authorization": "Bearer <TOKEN>"4 },5 "method": "get"6})
Path Parameter | Description |
---|---|
idOrAlias | string requiredThe alias or alias ID to be retrieved Example: example.vercel.app |
array
Code | Description |
---|---|
200 | The alias information |
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 |
Optional params
fetch-request
1await fetch("https://api.vercel.com/v4/aliases/example.vercel.app?from=1540095775951&projectId=prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB&since=1540095775941&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE&until=1540095775951", {2 "headers": {3 "Authorization": "Bearer <TOKEN>"4 },5 "method": "get"6})
Retrieves a list of aliases for the authenticated User or Team. When domain
is provided, only aliases for that domain will be returned. When projectId
is provided, it will only return the given project aliases.
Optional params
fetch-request
1await fetch("https://api.vercel.com/v4/aliases?domain=my-test-domain.com&from=1540095775951&limit=10&projectId=prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB&rollbackDeploymentId=dpl_XXX&since=1540095775941&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE&until=1540095775951", {2 "headers": {3 "Authorization": "Bearer <TOKEN>"4 },5 "method": "get"6})
Query Parameter | Description |
---|---|
domain | array <= 20 items | string of the following Get only aliases of the given domain name <= 20 items Example: my-test-domain.com type: array type: string |
from | number deprecatedGet only aliases created after the provided timestamp Example: 1540095775951 |
limit | number Maximum number of aliases to list from a request Example: 10 |
projectId | string Filter aliases from the given projectId Example: prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB |
rollbackDeploymentId | string Get aliases that would be rolled back for the given deployment Example: dpl_XXX |
since | number Get aliases created after this JavaScript timestamp Example: 1540095775941 |
slug | string The Team slug to perform the request on behalf of. |
teamId | string The Team identifier to perform the request on behalf of. |
until | number Get aliases created before this JavaScript timestamp Example: 1540095775951 |
aliasesarrayRequired paginationRequired
Code | Description |
---|---|
200 | The paginated list of aliases |
400 | One of the provided values in the request query is invalid. |
401 | |
403 | You do not have permission to access this resource. |
404 |
Optional params
fetch-request
1await fetch("https://api.vercel.com/v4/aliases?domain=my-test-domain.com&from=1540095775951&limit=10&projectId=prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB&rollbackDeploymentId=dpl_XXX&since=1540095775941&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE&until=1540095775951", {2 "headers": {3 "Authorization": "Bearer <TOKEN>"4 },5 "method": "get"6})
Retrieves all Aliases for the Deployment with the given ID. The authenticated user or team must own the deployment.
Optional params
fetch-request
1await fetch("https://api.vercel.com/v2/deployments/dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa/aliases?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {2 "headers": {3 "Authorization": "Bearer <TOKEN>"4 },5 "method": "get"6})
Path Parameter | Description |
---|---|
id | string requiredThe ID of the deployment the aliases should be listed for Example: dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa |
aliasesarrayRequired A list of the aliases assigned to the deployment
Code | Description |
---|---|
200 | The list of aliases assigned to the deployment |
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 deployment was not found |
Optional params
fetch-request
1await fetch("https://api.vercel.com/v2/deployments/dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa/aliases?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {2 "headers": {3 "Authorization": "Bearer <TOKEN>"4 },5 "method": "get"6})
Was this helpful?