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

# Get project routing rules

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

Get the routing rules for a project. Supports searching by name/ID/pattern, filtering by route type, and diffing staged changes against production.

## Path parameters

- `projectId` string, required

## Query parameters

- `versionId` string
- `q` string
- `filter` 'rewrite' | 'redirect' | 'set_status' | 'transform'
- `diff` union
  - boolean
  - 'only'
- `teamId` string
- `slug` string

## Response `200`

- union
  - object
  - object
    - `routes` object[], required
      - `id` string, required — Unique identifier for the routing rule.
      - `name` string, required — Human-readable name for the routing rule.
      - `description` string — Optional description of what the routing rule does.
      - `enabled` false | true — Whether the routing rule is enabled. Defaults to true.
      - `staged` false | true — Whether this route is new and not yet published to production. Set to true only when a route is first created via add-route. Cleared (set to false) when a version is promoted to production.
      - `route` object, required — The route definition from @vercel/routing-utils.
        - `src` string, required
        - `dest` string
        - `headers` object
        - `methods` string[]
        - `continue` false | true
        - `override` false | true
        - `caseSensitive` false | true
        - `check` false | true
        - `important` false | true
        - `status` number
        - `has` union[]
          - union
            - object
              - …
            - object
              - …
        - `missing` union[]
          - union
            - object
              - …
            - object
              - …
        - `mitigate` object
          - `action` 'challenge' | 'deny', required
        - `transforms` union[]
          - union
            - object
              - …
            - object
              - …
        - `env` string[]
        - `locale` object
          - `redirect` object
          - `cookie` string
        - `source` string — Aliases for `src`, `dest`, and `status`. These provide consistency with the `rewrites`, `redirects`, and `headers` fields which use `source`, `destination`, and `statusCode`. During normalization, the string forms are converted to their canonical forms (`src`, `dest`, `status`) and stripped from the route object. `destination` may also be a service-targeted object, in which case routing is delegated into the named service's internal route table and the object is preserved as-is (not folded into `dest`).
        - `destination` union
          - string
          - object
            - `type` 'service' — Optional explicit format marker. The destination is identified by the presence of `service`, so `type` is no longer required.
            - `service` string, required
            - `path` string — Routing-only path used to select a route inside the target service.
        - `statusCode` number
        - `middlewarePath` string — A middleware key within the `output` key under the build result. Overrides a `middleware` definition.
        - `middlewareRawSrc` string[] — The original middleware matchers.
        - `middleware` number — A middleware index in the `middleware` key under the build result
        - `respectOriginCacheControl` false | true
      - `rawSrc` string — Original source pattern provided by user (path-to-regexp or regex). Used to display the user's input in API responses.
      - `rawDest` string — Original destination provided by user.
      - `srcSyntax` 'equals' | 'path-to-regexp' | 'regex' — The syntax type of the source pattern. Determines how the pattern is compiled to regex.
      - `routeType` 'redirect' | 'rewrite' | 'set_status' | 'transform' — Computed route type based on the route configuration. Only present in API responses, not stored in S3.
    - `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.
    - `diffCount` number, required
  - object
    - `routes` object[], required
      - `id` string, required — Unique identifier for the routing rule.
      - `name` string, required — Human-readable name for the routing rule.
      - `description` string — Optional description of what the routing rule does.
      - `enabled` false | true — Whether the routing rule is enabled. Defaults to true.
      - `staged` false | true — Whether this route is new and not yet published to production. Set to true only when a route is first created via add-route. Cleared (set to false) when a version is promoted to production.
      - `route` object, required — The route definition from @vercel/routing-utils.
        - `src` string, required
        - `dest` string
        - `headers` object
        - `methods` string[]
        - `continue` false | true
        - `override` false | true
        - `caseSensitive` false | true
        - `check` false | true
        - `important` false | true
        - `status` number
        - `has` union[]
          - union
            - object
              - …
            - object
              - …
        - `missing` union[]
          - union
            - object
              - …
            - object
              - …
        - `mitigate` object
          - `action` 'challenge' | 'deny', required
        - `transforms` union[]
          - union
            - object
              - …
            - object
              - …
        - `env` string[]
        - `locale` object
          - `redirect` object
          - `cookie` string
        - `source` string — Aliases for `src`, `dest`, and `status`. These provide consistency with the `rewrites`, `redirects`, and `headers` fields which use `source`, `destination`, and `statusCode`. During normalization, the string forms are converted to their canonical forms (`src`, `dest`, `status`) and stripped from the route object. `destination` may also be a service-targeted object, in which case routing is delegated into the named service's internal route table and the object is preserved as-is (not folded into `dest`).
        - `destination` union
          - string
          - object
            - `type` 'service' — Optional explicit format marker. The destination is identified by the presence of `service`, so `type` is no longer required.
            - `service` string, required
            - `path` string — Routing-only path used to select a route inside the target service.
        - `statusCode` number
        - `middlewarePath` string — A middleware key within the `output` key under the build result. Overrides a `middleware` definition.
        - `middlewareRawSrc` string[] — The original middleware matchers.
        - `middleware` number — A middleware index in the `middleware` key under the build result
        - `respectOriginCacheControl` false | true
      - `rawSrc` string — Original source pattern provided by user (path-to-regexp or regex). Used to display the user's input in API responses.
      - `rawDest` string — Original destination provided by user.
      - `srcSyntax` 'equals' | 'path-to-regexp' | 'regex' — The syntax type of the source pattern. Determines how the pattern is compiled to regex.
      - `routeType` 'redirect' | 'rewrite' | 'set_status' | 'transform' — Computed route type based on the route configuration. Only present in API responses, not stored in S3.
    - `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.
  - object
    - `routes` object[], required
      - `id` string, required — Unique identifier for the routing rule.
      - `name` string, required — Human-readable name for the routing rule.
      - `description` string — Optional description of what the routing rule does.
      - `enabled` false | true — Whether the routing rule is enabled. Defaults to true.
      - `staged` false | true — Whether this route is new and not yet published to production. Set to true only when a route is first created via add-route. Cleared (set to false) when a version is promoted to production.
      - `route` object, required — The route definition from @vercel/routing-utils.
        - `src` string, required
        - `dest` string
        - `headers` object
        - `methods` string[]
        - `continue` false | true
        - `override` false | true
        - `caseSensitive` false | true
        - `check` false | true
        - `important` false | true
        - `status` number
        - `has` union[]
          - union
            - object
              - …
            - object
              - …
        - `missing` union[]
          - union
            - object
              - …
            - object
              - …
        - `mitigate` object
          - `action` 'challenge' | 'deny', required
        - `transforms` union[]
          - union
            - object
              - …
            - object
              - …
        - `env` string[]
        - `locale` object
          - `redirect` object
          - `cookie` string
        - `source` string — Aliases for `src`, `dest`, and `status`. These provide consistency with the `rewrites`, `redirects`, and `headers` fields which use `source`, `destination`, and `statusCode`. During normalization, the string forms are converted to their canonical forms (`src`, `dest`, `status`) and stripped from the route object. `destination` may also be a service-targeted object, in which case routing is delegated into the named service's internal route table and the object is preserved as-is (not folded into `dest`).
        - `destination` union
          - string
          - object
            - `type` 'service' — Optional explicit format marker. The destination is identified by the presence of `service`, so `type` is no longer required.
            - `service` string, required
            - `path` string — Routing-only path used to select a route inside the target service.
        - `statusCode` number
        - `middlewarePath` string — A middleware key within the `output` key under the build result. Overrides a `middleware` definition.
        - `middlewareRawSrc` string[] — The original middleware matchers.
        - `middleware` number — A middleware index in the `middleware` key under the build result
        - `respectOriginCacheControl` false | true
      - `rawSrc` string — Original source pattern provided by user (path-to-regexp or regex). Used to display the user's input in API responses.
      - `rawDest` string — Original destination provided by user.
      - `srcSyntax` 'equals' | 'path-to-regexp' | 'regex' — The syntax type of the source pattern. Determines how the pattern is compiled to regex.
      - `routeType` 'redirect' | 'rewrite' | 'set_status' | 'transform' — Computed route type based on the route configuration. Only present in API responses, not stored in S3.
    - `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.
    - `limit` object, required
      - `maxRoutes` number, required
      - `currentRoutes` number, required

## Other responses

- `400` — 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`
- `410`

---

[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)
