---
title: "Reorder match rules"
method: POST
path: "/v1/contexts/{contextId}/rules/reorder"
tags: ["Configuration Match Rules"]
---

# Reorder match rules

`POST /v1/contexts/{contextId}/rules/reorder`

Use this endpoint to reorder the priority of match rules within a specific context. The order determines which rules are evaluated first during reconciliation.

## Path parameters

- `contextId` string, required

## Headers

- `X-Request-Id` string
- `X-Idempotency-Key` string

## Request body

- ReorderRequest
  - `ruleIds` string[], required

## Response `204`

Match rules reordered.

The response includes the `X-Idempotency-Replayed` header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See [Retries and idempotency](/en/reference/retries-idempotency) for more details.

## Other responses

- `400` — Invalid reorder payload
- `401` — The request lacks valid authentication credentials.
- `403` — You do not have permission to access this resource.
- `404` — Context not found
- `500` — An unexpected error occurred on the server.

---

[API](https://skmtc.net/lerian/apis/identity-plugin.md) · [All operations](https://skmtc.net/lerian/apis/identity-plugin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lerian/identity-plugin/versions/25daba385532/schema)
