---
title: "Update a match rule"
method: PATCH
path: "/v1/contexts/{contextId}/rules/{ruleId}"
tags: ["Configuration Match Rules"]
---

# Update a match rule

`PATCH /v1/contexts/{contextId}/rules/{ruleId}`

Use this endpoint to update the fields of a specific match rule by its identifier.

## Path parameters

- `contextId` string, required
- `ruleId` string, required

## Headers

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

## Request body

- UpdateMatchRuleRequest
  - `config` object
  - `priority` integer
  - `type` 'EXACT' | 'TOLERANCE' | 'DATE_LAG' — Type of matching rule algorithm

## Response `200`

Successfully updated match rule.

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.

- MatchRuleResponse — Matching rule within a reconciliation context
  - `config` object — Rule configuration
  - `contextId` string — Context ID this rule belongs to
  - `createdAt` string — Creation timestamp in RFC3339 format
  - `id` string — Unique identifier for the rule
  - `priority` integer — Execution priority (lower = higher priority)
  - `type` 'EXACT' | 'TOLERANCE' | 'DATE_LAG' — Type of matching rule
  - `updatedAt` string — Last update timestamp in RFC3339 format

## Other responses

- `400` — Invalid request payload
- `401` — The request lacks valid authentication credentials.
- `403` — You do not have permission to access this resource.
- `404` — Match rule not found
- `409` — Priority conflict or idempotency conflict
- `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)
