---
title: "Mutate filtering rules"
method: PATCH
path: "/filtering-rules"
tags: ["filtering-rules"]
---

# Mutate filtering rules

`PATCH /filtering-rules`

Allows atomic mutation to filtering rules for an environment. Explicitly specify which list (`allow` or `deny`) you are mutating and which operation (`add` or `remove`) you want to execute with the given list of items.
Currently only supports origin domain filtering.

**Note**: It can take up to 5 minutes to start filtering incoming requests after setting a rule.

## Headers

- `X-API-Version` string, required

## Request body

- UpdateFilteringRuleDtoV1
  - `environment` string, required — ID of an environment for which we are mutating the filtering rules.
  - `permission` 'allow' | 'deny', required — Permission list we want to mutate, either `allow` or `deny`.
  - `op` 'add' | 'remove', required — Operation we are executing on specified permission list, either `add` or `remove`.
  - `items` string[], required — List of items we are mutating with the given operation on the given permission list.

## Response `200`

- D4735b2481c60fd3ef4bb
  - `data` FilteringRulesResponseDtoV1[], required
    - `type` 'origin', required — Type of filtering rule.
    - `environment` string, required — ID of an environment the filtering rule allies to.
    - `allow` string[], required — List of origin domains that are allowed to make API requests. Wildcard entry (`*`) implies all domains are allowed.
    - `deny` string[], required — List of origin domains that are denied from making API requests. Wildcard entry (`*`) implies all domains are denied.

## Other responses

- `400` — Error: Filtering rules can't be mutated due to validation errors.
- `401` — Error: Invalid API key.
- `429` — Error: API key has exceeded its rate limit.

---

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