---
title: "Create PII masking rule"
method: POST
path: "/api/v1/projects/{projectId}/pii-rules"
tags: ["PII Masking"]
---

# Create PII masking rule

`POST /api/v1/projects/{projectId}/pii-rules`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/projects/{projectId}/pii-rules`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Creates a new masking rule for the project

## Path parameters

- `projectId` string, uuid, required

## Request body

- PiiMaskingRuleRequest
  - `patternName` string, required
  - `jsonPath` string
  - `maskStyle` 'FULL' | 'PARTIAL' | 'HASH', required
  - `enabled` boolean

## Response `201`

Rule created

---

[API](https://skmtc.dev/railhook/apis/railhook-api.md) · [All operations](https://skmtc.dev/railhook/apis/railhook-api/llms.txt) · [OpenAPI document](https://skmtc.dev/railhook/apis/railhook-api/revisions/4e2c76dfc33d?raw)
