---
title: "Stage routing rules"
method: PUT
path: "/v1/projects/{projectId}/routes"
tags: ["project-routes"]
---

# Stage routing rules

`PUT /v1/projects/{projectId}/routes`

Stage routing rules for a project. Set `overwrite` to true to replace all existing rules, or omit it to merge with existing rules by ID. Returns the new staged version.

## Path parameters

- `projectId` string, required

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `overwrite` boolean
  - `routes` object[]
    - `id` string, required
    - `name` string, required
    - `description` string
    - `enabled` boolean
    - `route` object, required
      - `src` string, required
      - `dest` string
      - `headers` object
      - `caseSensitive` boolean
      - `status` integer
      - `has` object[]
        - `type` 'host' | 'header' | 'cookie' | 'query'
        - `key` string
        - `value` string
      - `missing` object[]
        - `type` 'host' | 'header' | 'cookie' | 'query'
        - `key` string
        - `value` string
      - `transforms` object[]
        - `type` 'request.headers' | 'request.query' | 'response.headers'
        - `op` 'append' | 'set' | 'delete'
        - `target` object
        - `args` unknown
        - `env` string[]
      - `respectOriginCacheControl` boolean

## Response `200`

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

## 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.
- `409`
- `410`
- `500`

---

[API](https://skmtc.net/vercel/apis/api.md) · [All operations](https://skmtc.net/vercel/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vercel/api/versions/61d1ba3f6dac/schema)
