---
title: "Promote, restore, or discard a routing rule version"
method: POST
path: "/v1/projects/{projectId}/routes/versions"
tags: ["project-routes"]
---

# Promote, restore, or discard a routing rule version

`POST /v1/projects/{projectId}/routes/versions`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v1/projects/{projectId}/routes/versions`
- Auth: HTTP bearer

Promote 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.

## Path parameters

- `projectId` string, required

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `id` string, required
  - `action` 'promote' | 'restore' | 'discard', required

## Response `200`

- object
  - `version` object, required: A version of routing rules stored in S3.
    - `alias` string: The staging alias for previewing this version.
    - `createdBy` string, required: The user who created this version.
    - `id` string, required: Unique identifier for the version.
    - `isLive` false | true: Whether this version is currently live in production.
    - `isStaging` false | true: Whether this version is staged and not yet promoted to production.
    - `lastModified` number, required: Timestamp of when this version was last modified.
    - `ruleCount` number: The number of routing rules in this version.
    - `s3Key` string, required: The S3 key where the routing rules are stored.

## Other responses

- `400`: One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
- `401`: The request is not authorized.
- `403`: You do not have permission to access this resource.
- `404`
- `409`
- `410`
- `500`

## Changes

- **2026-07-21** `2ae10ee9d21c`: 1 info
  - added the non-success response with the status `410`
- **2026-06-11** `14b4658f819e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v1/projects/:projectId/routes/versions/post.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
