Skip to main content

versions

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

Overview

Nameversions
TypeResource
Idvercel.bulk_redirects.versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier for the version.
namestringOptional name for the version. If not provided, defaults to an ISO timestamp string.
aliasstringThe staging link for previewing redirects in this version.
created_bystring (wire: createdBy)
is_livebooleanWhether this version is currently live in production. (false, true) (wire: isLive)
is_stagingbooleanWhether this version has not been promoted to production yet and is not serving end users. (false, true) (wire: isStaging)
keystringThe key of the version. The key may be duplicated across versions if the contents are the same as a different version.
last_modifiednumber (wire: lastModified)
redirect_countnumberThe number of redirects in this version. (wire: redirectCount)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectproject_idteam_id, slugGet the version history for a project's bulk redirects
updateexecprojectId, id, actionteamId, slugUpdate 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.

NameDatatypeDescription
projectIdstring
project_idstring (wire: projectId)
slugstringThe Team slug to perform the request on behalf of.
teamIdstringThe Team identifier to perform the request on behalf of.
team_idstringThe Team identifier to perform the request on behalf of. (wire: teamId)

SELECT examples

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 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 }}"
}'
;