---
title: "Update a data masking rule."
method: PUT
path: "/v1/dataMaskingRules/{id}"
tags: ["dataMaskingManagement"]
---

# Update a data masking rule.

`PUT /v1/dataMaskingRules/{id}`

Update an existing data masking rule. Only the fields provided in the request are updated; omitted fields retain their current values. The rule name is immutable and cannot be changed after creation.
**Note:** Changes to data masking rules may take up to 30 seconds to take effect.

## Path parameters

- `id` string, required

## Request body

- BaseDataMaskingRuleDefinition
  - `description` string — Optional description of the data masking rule. Provide context about what PII this rule masks and why it's needed.
  - `regexPattern` string — Regular expression pattern to match PII data that should be masked. The pattern must be valid according to Java regex syntax. All matches in search results will be replaced with the mask string. Required when creating a rule. When updating, if omitted the existing pattern is retained.
  - `maskString` string — The string to replace matched PII with. Defaults to '##redactedPII##' if not specified. Use descriptive mask strings like 'EMAIL_REDACTED' or 'PHONE_REDACTED' for clarity.
  - `enabled` boolean, required — Whether the data masking rule is active. Only enabled rules are applied to search results. Set to false to temporarily disable a rule without deleting it.

## Response `200`

The data masking rule was successfully modified.

- DataMaskingRule
  - `description` string — Optional description of the data masking rule. Provide context about what PII this rule masks and why it's needed.
  - `regexPattern` string, required — Regular expression pattern to match PII data that should be masked. The pattern must be valid according to Java regex syntax. All matches in search results will be replaced with the mask string. Required when creating a rule. When updating, if omitted the existing pattern is retained.
  - `maskString` string — The string to replace matched PII with. Defaults to '##redactedPII##' if not specified. Use descriptive mask strings like 'EMAIL_REDACTED' or 'PHONE_REDACTED' for clarity.
  - `enabled` boolean, required — Whether the data masking rule is active. Only enabled rules are applied to search results. Set to false to temporarily disable a rule without deleting it.
  - `name` string, required — Name of the data masking rule. Use a name that makes it easy to identify the rule. Must be unique within the organization. This field is immutable and cannot be changed after creation.
  - `createdAt` string, date-time, required — Creation timestamp in UTC in [RFC3339](https://tools.ietf.org/html/rfc3339) format.
  - `createdBy` string, required — Identifier of the user who created the resource.
  - `modifiedAt` string, date-time, required — Last modification timestamp in UTC.
  - `modifiedBy` string, required — Identifier of the user who last modified the resource.
  - `id` string, required — Unique identifier for the data masking rule.

## Other responses

- `default` — Operation failed with an error.

---

[API](https://skmtc.net/sumologic/apis/sumo-logic-api.md) · [All operations](https://skmtc.net/sumologic/apis/sumo-logic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sumologic/sumo-logic-api/versions/18a824df1e78/schema)
