---
title: "Assign an Alias"
method: POST
path: "/v2/deployments/{id}/aliases"
tags: ["aliases"]
---

# Assign an Alias

`POST /v2/deployments/{id}/aliases`

Creates a new alias for the deployment resolved from the given deployment or alias ID or URL. 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 deployment or alias ID or URL to assign from

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `alias` string — The alias we want to assign to the deployment defined in the URL
  - `redirect` string, nullable — 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

## Response `200`

The alias was successfully assigned to the deployment

- object
  - `uid` string, required — The unique identifier of the alias
  - `alias` string, required — The assigned alias name
  - `created` string, date-time, required — The date when the alias was created
  - `oldDeploymentId` string, nullable — The unique identifier of the previously aliased deployment, only received when the alias was used before

## Other 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` — The request is not authorized.
- `402` — 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
- `410`

---

[API](https://skmtc.net/vercel/apis/api.md) · [All operations](https://skmtc.net/vercel/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vercel/api/versions/61d1ba3f6dac/schema)
