Skip to main content

deployment_aliases

Creates, updates, deletes, gets or lists a deployment_aliases resource.

Overview​

Namedeployment_aliases
TypeResource
Idvercel.aliases.deployment_aliases

Fields​

The following fields are returned by SELECT queries:

The list of aliases assigned to the deployment

NameDatatypeDescription
aliasstringThe alias name, it could be a .vercel.app subdomain or a custom domain (example: my-alias.vercel.app)
createdstring (date-time)The date when the alias was created (example: 2017-04-26T23:00:34.232Z)
protection_bypassobjectThe protection bypass for the alias (wire: protectionBypass)
redirectstringTarget destination domain for redirect when the alias is a redirect
uidstringThe unique identifier of the alias (example: 2WjyKQmM8ZnGcJsPWMrHRHrE)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectidteam_id, slugRetrieves all Aliases for the Deployment with the given ID. The authenticated user or team must own the deployment.
assigninsertidteam_id, slugCreates 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.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idThe deployment or alias ID or URL to assign from
slugstringThe Team slug to perform the request on behalf of.
team_idstringThe Team identifier to perform the request on behalf of. (wire: teamId)

SELECT examples​

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

SELECT
alias,
created,
protection_bypass,
redirect,
uid
FROM vercel.aliases.deployment_aliases
WHERE id = '{{ id }}' -- required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;

INSERT examples​

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.

INSERT INTO vercel.aliases.deployment_aliases (
alias,
redirect,
id,
team_id,
slug
)
SELECT
'{{ alias }}',
'{{ redirect }}',
'{{ id }}',
'{{ team_id }}',
'{{ slug }}'
RETURNING
old_deployment_id,
alias,
created,
uid
;