post/v2/deployments/{id}/aliases

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

1
await 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 Params
Query Params
Body Params
Path ParameterDescription

id

string of the following

required
The 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

CodeDescription
200The alias was successfully assigned to the deployment
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

delete/v2/aliases/{aliasId}

Delete an Alias with the specified ID.

Optional params

fetch-request

1
await 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 Params
Query Params
Path ParameterDescription

aliasId

string of the following

required
The ID or alias that will be removed
Example:2WjyKQmM8ZnGcJsPWMrHRHrE
type: string
  • statusstringRequired
    One of: SUCCESS
CodeDescription
200The alias was successfully removed
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404The alias was not found
get/v4/aliases/{idOrAlias}

Retrieves an Alias for the given host name or alias ID.

Optional params

fetch-request

1
await 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 Params
Query Params
Path ParameterDescription

idOrAlias

string

required
The alias or alias ID to be retrieved
Example:example.vercel.app
  • array
  • Array
CodeDescription
200The alias information
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404The alias was not found
get/v4/aliases

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

1
await 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 Params
Query ParameterDescription

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

deprecated
Get 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
  • Properties
  • paginationRequired
CodeDescription
200The paginated list of aliases
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
get/v2/deployments/{id}/aliases

Retrieves all Aliases for the Deployment with the given ID. The authenticated user or team must own the deployment.

Optional params

fetch-request

1
await 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 Params
Query Params
Path ParameterDescription

id

string

required
The ID of the deployment the aliases should be listed for
Example:dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa
  • aliasesarrayRequired
    A list of the aliases assigned to the deployment
  • Properties
CodeDescription
200The list of aliases assigned to the deployment
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404The deployment was not found
Last updated on November 23, 2024