> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fingerprint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mutate 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.



## OpenAPI

````yaml reference/management-api_2024-05-20.json PATCH /filtering-rules
openapi: 3.0.0
info:
  title: Management API
  description: >-
    Managment API allows you to manage your Fingerprint account and applications
    programmatically from a server environment.
  version: '2024-05-20'
  contact: {}
servers:
  - url: https://management-api.fpjs.io
security:
  - Management-API-key: []
tags: []
paths:
  /filtering-rules:
    patch:
      tags:
        - filtering-rules
      summary: Mutate filtering rules
      description: >-
        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.
      operationId: FilteringRulesController_update
      parameters:
        - name: X-API-Version
          in: header
          description: Management API version.
          example: '2024-05-20'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFilteringRuleDtoV1'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/d4735b2481c60fd3ef4bb'
        '400':
          description: 'Error: Filtering rules can''t be mutated due to validation errors.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationApiExceptionDto'
        '401':
          description: 'Error: Invalid API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionDto'
        '429':
          description: 'Error: API key has exceeded its rate limit.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiExceptionDto'
components:
  schemas:
    UpdateFilteringRuleDtoV1:
      type: object
      properties:
        environment:
          type: string
          description: ID of an environment for which we are mutating the filtering rules.
        permission:
          type: string
          enum:
            - allow
            - deny
          description: Permission list we want to mutate, either `allow` or `deny`.
        op:
          type: string
          enum:
            - add
            - remove
          description: >-
            Operation we are executing on specified permission list, either
            `add` or `remove`.
        items:
          description: >-
            List of items we are mutating with the given operation on the given
            permission list.
          type: array
          items:
            type: string
      required:
        - environment
        - permission
        - op
        - items
    d4735b2481c60fd3ef4bb:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FilteringRulesResponseDtoV1'
      required:
        - data
    ValidationApiExceptionDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/BaseValidationApiExceptionDto'
      required:
        - error
    ApiExceptionDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/BaseApiExceptionDto'
      required:
        - error
    FilteringRulesResponseDtoV1:
      type: object
      properties:
        type:
          type: string
          enum:
            - origin
          description: Type of filtering rule.
          example: origin
        environment:
          type: string
          description: ID of an environment the filtering rule allies to.
          example: ae_rrETjdWcfqI6AFsk
        allow:
          description: >-
            List of origin domains that are allowed to make API requests.
            Wildcard entry (`*`) implies all domains are allowed.
          example:
            - example.com
            - my-website.com
          type: array
          items:
            type: string
        deny:
          description: >-
            List of origin domains that are denied from making API requests.
            Wildcard entry (`*`) implies all domains are denied.
          example:
            - '*'
          type: array
          items:
            type: string
      required:
        - type
        - environment
        - allow
        - deny
    BaseValidationApiExceptionDto:
      type: object
      properties:
        message:
          type: string
          description: Verbal description of the error.
        code:
          type: string
          description: Error code.
        violations:
          description: List of validation violations.
          type: array
          items:
            $ref: '#/components/schemas/BaseValidationApiExceptionViolationDto'
      required:
        - message
        - code
    BaseApiExceptionDto:
      type: object
      properties:
        message:
          type: string
          description: Verbal description of the error.
        code:
          type: string
          description: Error code.
      required:
        - message
        - code
    BaseValidationApiExceptionViolationDto:
      type: object
      properties:
        property:
          type: string
          description: Property that has failed validation.
        message:
          type: string
          description: Description of the violation.
      required:
        - property
        - message
  securitySchemes:
    Management-API-key:
      scheme: bearer
      bearerFormat: JWT
      type: http

````