---
title: "create a new protection rule"
method: POST
path: "/w/{workspace}/workspaces/protection_rules"
tags: ["workspace"]
---

# create a new protection rule

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

## Path parameters

- `workspace` string, required

## Request body

- object
  - `name` string, required — Unique name for the protection rule
  - `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 created successfully

## Other responses

- `400` — rule with this name already exists

---

[API](https://skmtc.net/windmill/apis/windmill-api.md) · [All operations](https://skmtc.net/windmill/apis/windmill-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/windmill/windmill-api/versions/155a35b3caff/schema)
