versions
Creates, updates, deletes, gets or lists a versions resource.
Overview
| Name | versions |
| Type | Resource |
| Id | vercel.bulk_redirects.versions |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the version. |
name | string | Optional name for the version. If not provided, defaults to an ISO timestamp string. |
alias | string | The staging link for previewing redirects in this version. |
created_by | string | (wire: createdBy) |
is_live | boolean | Whether this version is currently live in production. (false, true) (wire: isLive) |
is_staging | boolean | Whether this version has not been promoted to production yet and is not serving end users. (false, true) (wire: isStaging) |
key | string | The key of the version. The key may be duplicated across versions if the contents are the same as a different version. |
last_modified | number | (wire: lastModified) |
redirect_count | number | The number of redirects in this version. (wire: redirectCount) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | project_id | team_id, slug | Get the version history for a project's bulk redirects |
update | exec | projectId, id, action | teamId, slug | Update a version by promoting staging to production or restoring a previous production version |
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 |
|---|---|---|
projectId | string | |
project_id | string | (wire: projectId) |
slug | string | The Team slug to perform the request on behalf of. |
teamId | string | The Team identifier 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
Get the version history for a project's bulk redirects
SELECT
id,
name,
alias,
created_by,
is_live,
is_staging,
key,
last_modified,
redirect_count
FROM vercel.bulk_redirects.versions
WHERE project_id = '{{ project_id }}' -- required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
Lifecycle Methods
EXEC variables use wire (API) names.
- update
Update a version by promoting staging to production or restoring a previous production version
EXEC vercel.bulk_redirects.versions.update
@projectId='{{ projectId }}' --required,
@teamId='{{ teamId }}',
@slug='{{ slug }}'
@@json=
'{
"id": "{{ id }}",
"action": "{{ action }}",
"name": "{{ name }}"
}'
;