---
title: "update an existing protection rule"
method: POST
path: "/w/{workspace}/workspaces/protection_rules/{rule_name}"
tags: ["workspace"]
---

# update an existing protection rule

`POST /w/{workspace}/workspaces/protection_rules/{rule_name}`

## Path parameters

- `workspace` string, required
- `rule_name` string, required

## Request body

- object
  - `name` string — New name for the rule. Omit, or pass the current name, to leave it unchanged. The reserved `dev_workspace_lock` rule cannot be renamed, nor can another rule be renamed onto it.
  - `rules` ProtectionRuleKind[], required — Configuration of protection restrictions
  - `bypass_groups` string[], required — Groups that can bypass this ruleset
  - `bypass_users` string[], required — Users that can bypass this ruleset

## Response `200`

protection rule updated successfully

## Other responses

- `404` — protection rule not found

## Changes

- **2026-08-06** `966123aa8b8b` — 1 info
  - added the new `RestrictPublicRunSharing` enum value to the request property `rules/items/`
- **2026-08-04** `0855ae032325` — 1 info
  - added the new optional request property `name`

[Change history](https://skmtc.dev/windmill/apis/windmill-api/changes/w/:workspace/workspaces/protection_rules/:rule_name/post.md)

---

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