---
title: get-project-routing-rules
product: vercel
url: /docs/rest-api/project-routes/get-project-routing-rules
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about get-project-routing-rules on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Get project routing rules

```http
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.

## Authentication

**bearerToken**: HTTP bearer

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `projectId` | string | Yes |  |


## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `versionId` | string | No |  |
| `q` | string | No |  |
| `filter` | string. enum: rewrite, redirect, set_status, transform | No |  |
| `diff` | object | No |  |
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Responses

### 200: No description

Content-Type: `application/json`

```json
{
  "oneOf": [
    {
      "type": "object"
    },
    {
      "type": "object",
      "required": [
        "diffCount",
        "routes",
        "version"
      ],
      "properties": {
        "routes": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A routing rule with metadata for project-level routing.",
            "required": [
              "id",
              "name",
              "route"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier for the routing rule."
              },
              "name": {
                "type": "string",
                "description": "Human-readable name for the routing rule."
              },
              "description": {
                "type": "string",
                "description": "Optional description of what the routing rule does."
              },
              "enabled": {
                "type": "boolean",
                "description": "Whether the routing rule is enabled. Defaults to true.",
                "enum": [
                  false,
                  true
                ]
              },
              "staged": {
                "type": "boolean",
                "description": "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.",
                "enum": [
                  false,
                  true
                ]
              },
              "route": {
                "type": "object",
                "description": "The route definition from @vercel/routing-utils.",
                "required": [
                  "src"
                ],
                "properties": {
                  "src": {
                    "type": "string"
                  },
                  "dest": {
                    "type": "string"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "methods": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "continue": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "override": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "caseSensitive": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "check": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "important": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "status": {
                    "type": "number"
                  },
                  "has": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "value"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "host"
                              ]
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "required": [
                            "key",
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "header",
                                "cookie",
                                "query"
                              ]
                            },
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "value"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "host"
                              ]
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "required": [
                            "key",
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "header",
                                "cookie",
                                "query"
                              ]
                            },
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "mitigate": {
                    "type": "object",
                    "required": [
                      "action"
                    ],
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "challenge",
                          "deny"
                        ]
                      }
                    }
                  },
                  "transforms": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "op",
                        "target",
                        "type"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "request.headers",
                            "request.query",
                            "response.headers"
                          ]
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "append",
                            "set",
                            "delete"
                          ]
                        },
                        "target": {
                          "type": "object",
                          "required": [
                            "key"
                          ],
                          "properties": {
                            "key": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        "args": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "env": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "env": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "locale": {
                    "type": "object",
                    "properties": {
                      "redirect": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "cookie": {
                        "type": "string"
                      }
                    }
                  },
                  "source": {
                    "type": "string",
                    "description": "Aliases for `src`, `dest`, and `status`. These provide consistency with the `rewrites`, `redirects`, and `headers` fields which use `source`, `destination`, and `statusCode`. During normalization, these are converted to their canonical forms (`src`, `dest`, `status`) and stripped from the route object."
                  },
                  "destination": {
                    "type": "string"
                  },
                  "statusCode": {
                    "type": "number"
                  },
                  "middlewarePath": {
                    "type": "string",
                    "description": "A middleware key within the `output` key under the build result. Overrides a `middleware` definition."
                  },
                  "middlewareRawSrc": {
                    "type": "array",
                    "description": "The original middleware matchers.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "middleware": {
                    "type": "number",
                    "description": "A middleware index in the `middleware` key under the build result"
                  },
                  "respectOriginCacheControl": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  }
                }
              },
              "rawSrc": {
                "type": "string",
                "description": "Original source pattern provided by user (path-to-regexp or regex). Used to display the user's input in API responses."
              },
              "rawDest": {
                "type": "string",
                "description": "Original destination provided by user."
              },
              "srcSyntax": {
                "type": "string",
                "description": "The syntax type of the source pattern. Determines how the pattern is compiled to regex.",
                "enum": [
                  "equals",
                  "path-to-regexp",
                  "regex"
                ]
              },
              "routeType": {
                "type": "string",
                "description": "Computed route type based on the route configuration. Only present in API responses, not stored in S3.",
                "enum": [
                  "rewrite",
                  "redirect",
                  "set_status",
                  "transform"
                ]
              }
            }
          }
        },
        "version": {
          "type": "object",
          "description": "A version of routing rules stored in S3.",
          "required": [
            "createdBy",
            "id",
            "lastModified",
            "s3Key"
          ],
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the version."
            },
            "s3Key": {
              "type": "string",
              "description": "The S3 key where the routing rules are stored."
            },
            "lastModified": {
              "type": "number",
              "description": "Timestamp of when this version was last modified."
            },
            "createdBy": {
              "type": "string",
              "description": "The user who created this version."
            },
            "isStaging": {
              "type": "boolean",
              "description": "Whether this version is staged and not yet promoted to production.",
              "enum": [
                false,
                true
              ]
            },
            "isLive": {
              "type": "boolean",
              "description": "Whether this version is currently live in production.",
              "enum": [
                false,
                true
              ]
            },
            "ruleCount": {
              "type": "number",
              "description": "The number of routing rules in this version."
            },
            "alias": {
              "type": "string",
              "description": "The staging alias for previewing this version."
            }
          }
        },
        "diffCount": {
          "type": "number"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "routes",
        "version"
      ],
      "properties": {
        "routes": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A routing rule with metadata for project-level routing.",
            "required": [
              "id",
              "name",
              "route"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier for the routing rule."
              },
              "name": {
                "type": "string",
                "description": "Human-readable name for the routing rule."
              },
              "description": {
                "type": "string",
                "description": "Optional description of what the routing rule does."
              },
              "enabled": {
                "type": "boolean",
                "description": "Whether the routing rule is enabled. Defaults to true.",
                "enum": [
                  false,
                  true
                ]
              },
              "staged": {
                "type": "boolean",
                "description": "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.",
                "enum": [
                  false,
                  true
                ]
              },
              "route": {
                "type": "object",
                "description": "The route definition from @vercel/routing-utils.",
                "required": [
                  "src"
                ],
                "properties": {
                  "src": {
                    "type": "string"
                  },
                  "dest": {
                    "type": "string"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "methods": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "continue": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "override": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "caseSensitive": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "check": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "important": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "status": {
                    "type": "number"
                  },
                  "has": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "value"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "host"
                              ]
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "required": [
                            "key",
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "header",
                                "cookie",
                                "query"
                              ]
                            },
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "value"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "host"
                              ]
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "required": [
                            "key",
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "header",
                                "cookie",
                                "query"
                              ]
                            },
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "mitigate": {
                    "type": "object",
                    "required": [
                      "action"
                    ],
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "challenge",
                          "deny"
                        ]
                      }
                    }
                  },
                  "transforms": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "op",
                        "target",
                        "type"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "request.headers",
                            "request.query",
                            "response.headers"
                          ]
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "append",
                            "set",
                            "delete"
                          ]
                        },
                        "target": {
                          "type": "object",
                          "required": [
                            "key"
                          ],
                          "properties": {
                            "key": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        "args": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "env": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "env": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "locale": {
                    "type": "object",
                    "properties": {
                      "redirect": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "cookie": {
                        "type": "string"
                      }
                    }
                  },
                  "source": {
                    "type": "string",
                    "description": "Aliases for `src`, `dest`, and `status`. These provide consistency with the `rewrites`, `redirects`, and `headers` fields which use `source`, `destination`, and `statusCode`. During normalization, these are converted to their canonical forms (`src`, `dest`, `status`) and stripped from the route object."
                  },
                  "destination": {
                    "type": "string"
                  },
                  "statusCode": {
                    "type": "number"
                  },
                  "middlewarePath": {
                    "type": "string",
                    "description": "A middleware key within the `output` key under the build result. Overrides a `middleware` definition."
                  },
                  "middlewareRawSrc": {
                    "type": "array",
                    "description": "The original middleware matchers.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "middleware": {
                    "type": "number",
                    "description": "A middleware index in the `middleware` key under the build result"
                  },
                  "respectOriginCacheControl": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  }
                }
              },
              "rawSrc": {
                "type": "string",
                "description": "Original source pattern provided by user (path-to-regexp or regex). Used to display the user's input in API responses."
              },
              "rawDest": {
                "type": "string",
                "description": "Original destination provided by user."
              },
              "srcSyntax": {
                "type": "string",
                "description": "The syntax type of the source pattern. Determines how the pattern is compiled to regex.",
                "enum": [
                  "equals",
                  "path-to-regexp",
                  "regex"
                ]
              },
              "routeType": {
                "type": "string",
                "description": "Computed route type based on the route configuration. Only present in API responses, not stored in S3.",
                "enum": [
                  "rewrite",
                  "redirect",
                  "set_status",
                  "transform"
                ]
              }
            }
          }
        },
        "version": {
          "type": "object",
          "description": "A version of routing rules stored in S3.",
          "required": [
            "createdBy",
            "id",
            "lastModified",
            "s3Key"
          ],
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the version."
            },
            "s3Key": {
              "type": "string",
              "description": "The S3 key where the routing rules are stored."
            },
            "lastModified": {
              "type": "number",
              "description": "Timestamp of when this version was last modified."
            },
            "createdBy": {
              "type": "string",
              "description": "The user who created this version."
            },
            "isStaging": {
              "type": "boolean",
              "description": "Whether this version is staged and not yet promoted to production.",
              "enum": [
                false,
                true
              ]
            },
            "isLive": {
              "type": "boolean",
              "description": "Whether this version is currently live in production.",
              "enum": [
                false,
                true
              ]
            },
            "ruleCount": {
              "type": "number",
              "description": "The number of routing rules in this version."
            },
            "alias": {
              "type": "string",
              "description": "The staging alias for previewing this version."
            }
          }
        }
      }
    },
    {
      "type": "object",
      "required": [
        "limit",
        "routes",
        "version"
      ],
      "properties": {
        "routes": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A routing rule with metadata for project-level routing.",
            "required": [
              "id",
              "name",
              "route"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier for the routing rule."
              },
              "name": {
                "type": "string",
                "description": "Human-readable name for the routing rule."
              },
              "description": {
                "type": "string",
                "description": "Optional description of what the routing rule does."
              },
              "enabled": {
                "type": "boolean",
                "description": "Whether the routing rule is enabled. Defaults to true.",
                "enum": [
                  false,
                  true
                ]
              },
              "staged": {
                "type": "boolean",
                "description": "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.",
                "enum": [
                  false,
                  true
                ]
              },
              "route": {
                "type": "object",
                "description": "The route definition from @vercel/routing-utils.",
                "required": [
                  "src"
                ],
                "properties": {
                  "src": {
                    "type": "string"
                  },
                  "dest": {
                    "type": "string"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "methods": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "continue": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "override": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "caseSensitive": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "check": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "important": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  },
                  "status": {
                    "type": "number"
                  },
                  "has": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "value"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "host"
                              ]
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "required": [
                            "key",
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "header",
                                "cookie",
                                "query"
                              ]
                            },
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "missing": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "value"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "host"
                              ]
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "object",
                          "required": [
                            "key",
                            "type"
                          ],
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "header",
                                "cookie",
                                "query"
                              ]
                            },
                            "key": {
                              "type": "string"
                            },
                            "value": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "re": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "mitigate": {
                    "type": "object",
                    "required": [
                      "action"
                    ],
                    "properties": {
                      "action": {
                        "type": "string",
                        "enum": [
                          "challenge",
                          "deny"
                        ]
                      }
                    }
                  },
                  "transforms": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "op",
                        "target",
                        "type"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "request.headers",
                            "request.query",
                            "response.headers"
                          ]
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "append",
                            "set",
                            "delete"
                          ]
                        },
                        "target": {
                          "type": "object",
                          "required": [
                            "key"
                          ],
                          "properties": {
                            "key": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "eq": {
                                      "oneOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    "neq": {
                                      "type": "string"
                                    },
                                    "inc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "ninc": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "pre": {
                                      "type": "string"
                                    },
                                    "suf": {
                                      "type": "string"
                                    },
                                    "gt": {
                                      "type": "number"
                                    },
                                    "gte": {
                                      "type": "number"
                                    },
                                    "lt": {
                                      "type": "number"
                                    },
                                    "lte": {
                                      "type": "number"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        "args": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "env": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "env": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "locale": {
                    "type": "object",
                    "properties": {
                      "redirect": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "cookie": {
                        "type": "string"
                      }
                    }
                  },
                  "source": {
                    "type": "string",
                    "description": "Aliases for `src`, `dest`, and `status`. These provide consistency with the `rewrites`, `redirects`, and `headers` fields which use `source`, `destination`, and `statusCode`. During normalization, these are converted to their canonical forms (`src`, `dest`, `status`) and stripped from the route object."
                  },
                  "destination": {
                    "type": "string"
                  },
                  "statusCode": {
                    "type": "number"
                  },
                  "middlewarePath": {
                    "type": "string",
                    "description": "A middleware key within the `output` key under the build result. Overrides a `middleware` definition."
                  },
                  "middlewareRawSrc": {
                    "type": "array",
                    "description": "The original middleware matchers.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "middleware": {
                    "type": "number",
                    "description": "A middleware index in the `middleware` key under the build result"
                  },
                  "respectOriginCacheControl": {
                    "type": "boolean",
                    "enum": [
                      false,
                      true
                    ]
                  }
                }
              },
              "rawSrc": {
                "type": "string",
                "description": "Original source pattern provided by user (path-to-regexp or regex). Used to display the user's input in API responses."
              },
              "rawDest": {
                "type": "string",
                "description": "Original destination provided by user."
              },
              "srcSyntax": {
                "type": "string",
                "description": "The syntax type of the source pattern. Determines how the pattern is compiled to regex.",
                "enum": [
                  "equals",
                  "path-to-regexp",
                  "regex"
                ]
              },
              "routeType": {
                "type": "string",
                "description": "Computed route type based on the route configuration. Only present in API responses, not stored in S3.",
                "enum": [
                  "rewrite",
                  "redirect",
                  "set_status",
                  "transform"
                ]
              }
            }
          }
        },
        "version": {
          "type": "object",
          "description": "A version of routing rules stored in S3.",
          "required": [
            "createdBy",
            "id",
            "lastModified",
            "s3Key"
          ],
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the version."
            },
            "s3Key": {
              "type": "string",
              "description": "The S3 key where the routing rules are stored."
            },
            "lastModified": {
              "type": "number",
              "description": "Timestamp of when this version was last modified."
            },
            "createdBy": {
              "type": "string",
              "description": "The user who created this version."
            },
            "isStaging": {
              "type": "boolean",
              "description": "Whether this version is staged and not yet promoted to production.",
              "enum": [
                false,
                true
              ]
            },
            "isLive": {
              "type": "boolean",
              "description": "Whether this version is currently live in production.",
              "enum": [
                false,
                true
              ]
            },
            "ruleCount": {
              "type": "number",
              "description": "The number of routing rules in this version."
            },
            "alias": {
              "type": "string",
              "description": "The staging alias for previewing this version."
            }
          }
        },
        "limit": {
          "type": "object",
          "required": [
            "currentRoutes",
            "maxRoutes"
          ],
          "properties": {
            "maxRoutes": {
              "type": "number"
            },
            "currentRoutes": {
              "type": "number"
            }
          }
        }
      }
    }
  ]
}
```

### 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: No description

---

## Related

- [project-routes endpoints](/docs/rest-api#project-routes)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://openapi.vercel.sh/) (machine-readable, all endpoints)

---

[View full sitemap](/docs/sitemap)
