---
title: "Update redirect/rewrite rule priority"
method: PATCH
path: "/services/{serviceId}/routes/{routeId}"
tags: ["Services - Routes"]
---

# Update redirect/rewrite rule priority

`PATCH /services/{serviceId}/routes/{routeId}`

Update the priority for a particular redirect/rewrite rule.

To apply redirect/rewrite rules to an incoming request, Render starts from the rule with priority `0` and applies the first encountered rule that matches the request's path (if any).

Render increments the priority of other rules by `1` as necessary to make space for the updated rule.

## Request body

- RoutePatch
  - `priority` integer, required — Redirect and Rewrite Rules are applied in priority order starting at 0. Moves this route to the specified priority and adjusts other route priorities accordingly.

## Response `200`

Updated

- object
  - `headers` Route
    - `id` string, required
    - `type` 'redirect' | 'rewrite', required
    - `source` string, required
    - `destination` string, required
    - `priority` integer, required — Redirect and Rewrite Rules are applied in priority order starting at 0

## Other responses

- `401` — Authorization information is missing or invalid.
- `403` — You do not have permissions for the requested resource.
- `404` — Unable to find the requested resource.
- `406` — Unable to generate preferred media types as specified by Accept request header.
- `410` — The requested resource is no longer available.
- `429` — Rate limit has been surpassed.
- `500` — An unexpected server error has occurred.
- `503` — Server currently unavailable.

---

[API](https://skmtc.dev/render/apis/render-public-api.md) · [All operations](https://skmtc.dev/render/apis/render-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/render/render-public-api/revisions/80e0ff74d033/schema)
