import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.rollingRelease.approveRollingReleaseStage({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();{
"rollingRelease": {
"state": "ACTIVE",
"currentDeployment": {
"id": "dpl_abc123",
"name": "my-shop@main",
"url": "my-shop.vercel.app",
"target": "production",
"source": "git",
"createdAt": 1716206500000,
"readyState": "READY",
"readyStateAt": 1716206800000
},
"canaryDeployment": {
"id": "dpl_def456",
"name": "my-shop@9c7e2f4",
"url": "9c7e2f4-my-shop.vercel.app",
"target": "production",
"source": "git",
"createdAt": 1716210100000,
"readyState": "READY",
"readyStateAt": 1716210400000
},
"queuedDeploymentId": "dpl_ghi789",
"advancementType": "manual-approval",
"stages": [
{
"index": 0,
"isFinalStage": false,
"targetPercentage": 5,
"requireApproval": true,
"duration": null
},
{
"index": 1,
"isFinalStage": false,
"targetPercentage": 25,
"requireApproval": true,
"duration": null
},
{
"index": 2,
"isFinalStage": false,
"targetPercentage": 60,
"requireApproval": true,
"duration": null
},
{
"index": 3,
"isFinalStage": true,
"targetPercentage": 100,
"requireApproval": false,
"duration": null
}
],
"activeStage": {
"index": 1,
"isFinalStage": false,
"targetPercentage": 25,
"requireApproval": true,
"duration": null
},
"nextStage": {
"index": 2,
"isFinalStage": false,
"targetPercentage": 60,
"requireApproval": true,
"duration": null
},
"startedAt": 1716210500000,
"updatedAt": 1716210600000
}
}Advance a rollout to the next stage. This is only needed when rolling releases is configured to require manual approval.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.rollingRelease.approveRollingReleaseStage({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();{
"rollingRelease": {
"state": "ACTIVE",
"currentDeployment": {
"id": "dpl_abc123",
"name": "my-shop@main",
"url": "my-shop.vercel.app",
"target": "production",
"source": "git",
"createdAt": 1716206500000,
"readyState": "READY",
"readyStateAt": 1716206800000
},
"canaryDeployment": {
"id": "dpl_def456",
"name": "my-shop@9c7e2f4",
"url": "9c7e2f4-my-shop.vercel.app",
"target": "production",
"source": "git",
"createdAt": 1716210100000,
"readyState": "READY",
"readyStateAt": 1716210400000
},
"queuedDeploymentId": "dpl_ghi789",
"advancementType": "manual-approval",
"stages": [
{
"index": 0,
"isFinalStage": false,
"targetPercentage": 5,
"requireApproval": true,
"duration": null
},
{
"index": 1,
"isFinalStage": false,
"targetPercentage": 25,
"requireApproval": true,
"duration": null
},
{
"index": 2,
"isFinalStage": false,
"targetPercentage": 60,
"requireApproval": true,
"duration": null
},
{
"index": 3,
"isFinalStage": true,
"targetPercentage": 100,
"requireApproval": false,
"duration": null
}
],
"activeStage": {
"index": 1,
"isFinalStage": false,
"targetPercentage": 25,
"requireApproval": true,
"duration": null
},
"nextStage": {
"index": 2,
"isFinalStage": false,
"targetPercentage": 60,
"requireApproval": true,
"duration": null
},
"startedAt": 1716210500000,
"updatedAt": 1716210600000
}
}Default authentication mechanism
Project ID or project name (URL-encoded)
The Team identifier to perform the request on behalf of.
"team_1a2b3c4d5e6f7g8h9i0j1k2l"
The Team slug to perform the request on behalf of.
"my-team-url-slug"
The response format for rolling release endpoints that return rolling release information
Rolling release information including configuration and document details, or null if no rolling release exists
Show child attributes
The current state of the rolling release
ACTIVE, COMPLETE, ABORTED "ACTIVE"
The current deployment receiving production traffic
Show child attributes
A string holding the unique ID of the deployment
"dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ"
The name of the project associated with the deployment at the time that the deployment was created
"my-project"
A string with the unique URL of the deployment
"my-instant-deployment-3ij3cxz9qr.now.sh"
A number containing the date when the deployment was created in milliseconds
1540257589405
The state of the deployment depending on the process of deploying, or if it is ready or in an error state
BUILDING, ERROR, INITIALIZING, QUEUED, READY, CANCELED "READY"
If defined, either staging if a staging alias in the format <project>.<team>.now.sh was assigned upon creation, or production if the aliases from alias were assigned. null value indicates the "preview" deployment.
staging, production null
Where was the deployment created from
api-trigger-git-deploy, cli, clone/repo, git, import, import/repo, redeploy, v0-web "cli"
{
"id": "dpl_abc123",
"name": "my-shop@main",
"url": "my-shop.vercel.app",
"target": "production",
"source": "git",
"createdAt": 1716206500000,
"readyState": "READY",
"readyStateAt": 1716206800000
}The canary deployment being rolled out
Show child attributes
A string holding the unique ID of the deployment
"dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ"
The name of the project associated with the deployment at the time that the deployment was created
"my-project"
A string with the unique URL of the deployment
"my-instant-deployment-3ij3cxz9qr.now.sh"
A number containing the date when the deployment was created in milliseconds
1540257589405
The state of the deployment depending on the process of deploying, or if it is ready or in an error state
BUILDING, ERROR, INITIALIZING, QUEUED, READY, CANCELED "READY"
If defined, either staging if a staging alias in the format <project>.<team>.now.sh was assigned upon creation, or production if the aliases from alias were assigned. null value indicates the "preview" deployment.
staging, production null
Where was the deployment created from
api-trigger-git-deploy, cli, clone/repo, git, import, import/repo, redeploy, v0-web "cli"
{
"id": "dpl_def456",
"name": "my-shop@9c7e2f4",
"url": "9c7e2f4-my-shop.vercel.app",
"target": "production",
"source": "git",
"createdAt": 1716210100000,
"readyState": "READY",
"readyStateAt": 1716210400000
}The ID of a deployment queued for the next rolling release
"dpl_ghi789"
The advancement type of the rolling release
automatic, manual-approval "manual-approval"
All stages configured for this rolling release
Show child attributes
The zero-based index of the stage
0
Whether or not this stage is the final stage (targetPercentage === 100)
false
The percentage of traffic to serve to the canary deployment (0-100)
25
Whether or not this stage requires manual approval to proceed
Duration in seconds for automatic advancement, null for manual stages or the final stage
null
Whether to linearly shift traffic over the duration of this stage
false
[
{
"index": 0,
"isFinalStage": false,
"targetPercentage": 5,
"requireApproval": true,
"duration": null
},
{
"index": 1,
"isFinalStage": false,
"targetPercentage": 25,
"requireApproval": true,
"duration": null
},
{
"index": 2,
"isFinalStage": false,
"targetPercentage": 60,
"requireApproval": true,
"duration": null
},
{
"index": 3,
"isFinalStage": true,
"targetPercentage": 100,
"requireApproval": false,
"duration": null
}
]The currently active stage, null if the rollout is aborted
Show child attributes
The zero-based index of the stage
0
Whether or not this stage is the final stage (targetPercentage === 100)
false
The percentage of traffic to serve to the canary deployment (0-100)
25
Whether or not this stage requires manual approval to proceed
Duration in seconds for automatic advancement, null for manual stages or the final stage
null
Whether to linearly shift traffic over the duration of this stage
false
{
"index": 1,
"isFinalStage": false,
"targetPercentage": 25,
"requireApproval": true,
"duration": null
}The next stage to be activated, null if not in ACTIVE state
Show child attributes
The zero-based index of the stage
0
Whether or not this stage is the final stage (targetPercentage === 100)
false
The percentage of traffic to serve to the canary deployment (0-100)
25
Whether or not this stage requires manual approval to proceed
Duration in seconds for automatic advancement, null for manual stages or the final stage
null
Whether to linearly shift traffic over the duration of this stage
false
{
"index": 2,
"isFinalStage": false,
"targetPercentage": 60,
"requireApproval": true,
"duration": null
}Unix timestamp in milliseconds when the rolling release started
1716210500000
Unix timestamp in milliseconds when the rolling release was last updated
1716210600000