deployment_aliases
Creates, updates, deletes, gets or lists a deployment_aliases resource.
Overview​
| Name | deployment_aliases |
| Type | Resource |
| Id | vercel.aliases.deployment_aliases |
Fields​
The following fields are returned by SELECT queries:
- list
The list of aliases assigned to the deployment
| Name | Datatype | Description |
|---|---|---|
alias | string | The alias name, it could be a .vercel.app subdomain or a custom domain (example: my-alias.vercel.app) |
created | string (date-time) | The date when the alias was created (example: 2017-04-26T23:00:34.232Z) |
protection_bypass | object | The protection bypass for the alias (wire: protectionBypass) |
redirect | string | Target destination domain for redirect when the alias is a redirect |
uid | string | The unique identifier of the alias (example: 2WjyKQmM8ZnGcJsPWMrHRHrE) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | id | team_id, slug | Retrieves all Aliases for the Deployment with the given ID. The authenticated user or team must own the deployment. |
assign | insert | id | team_id, slug | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
id | | The deployment or alias ID or URL to assign from |
slug | string | The Team slug to perform the request on behalf of. |
team_id | string | The Team identifier to perform the request on behalf of. (wire: teamId) |
SELECT examples​
- list
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​
- assign
- Manifest
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
;
# Description fields are for documentation purposes
- name: deployment_aliases
props:
- name: id
value: "{{ id }}"
description: Required parameter for the deployment_aliases resource.
- name: alias
value: "{{ alias }}"
description: |
The alias we want to assign to the deployment defined in the URL
- name: redirect
value: "{{ redirect }}"
description: |
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
- name: team_id
value: "{{ team_id }}"
description: The Team identifier to perform the request on behalf of.
description: The Team identifier to perform the request on behalf of.
- name: slug
value: "{{ slug }}"
description: The Team slug to perform the request on behalf of.
description: The Team slug to perform the request on behalf of.