Promote, restore, or discard a routing rule version
POST
/__remote/api.vercel.com/v1/projects/{projectId}/routes/versionsPromote staged routing rules to production, restore a previous production version, or discard staged changes. -
promote: Publishes the staging version to production. - restore: Rolls back to a previous production version. - discard: Removes the staging version without publishing./__remote/api.vercel.com/v1/projects/{projectId}/routes/versions
const response = await fetch('/__remote/api.vercel.com/v1/projects/projectId/routes/versions?teamId=string&slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "id": "icfg_1234567890", "action": "promote" }),});
const data = await response.json();console.log(data);Response
{ "version": { "alias": "string", "createdBy": "string", "id": "icfg_1234567890", "isLive": "false", "isStaging": "false", "lastModified": "123", "ruleCount": "123", "s3Key": "string" }}AuthorizationbearerToken
Default authentication mechanism
400One of the provided values in the request body is invalid.
One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
409Error
410Error
500Error