---
title: "Update a path permission"
method: PATCH
path: "/repos/{repo_id}/granular-permissions/{permission_id}"
tags: ["Repository Granular Permissions"]
---

# Update a path permission

`PATCH /repos/{repo_id}/granular-permissions/{permission_id}`

Update an existing path permission rule

## Request body

- ModifyGranularPermission
  - `user_id` string — User ID to assign this permission to (mutually exclusive with group_id)
  - `group_id` string — Group ID to assign this permission to (mutually exclusive with `user_id`)
  - `path_pattern` string, required — Path pattern for matching files. Supports wildcards: "/path/to/file" for exact match, "/path/..." for recursive wildcard, "/path/*.ext" for extension matching.
  - `access_level` 'ADMIN' | 'WRITE' | 'READ' | 'NO_ACCESS', required — Access level for path permissions. Hierarchical: ADMIN > WRITE > READ > NO_ACCESS.
  - `permission_type` 'ALLOW_LT_EQ' | 'ALLOW_EQ' | 'DENY_ALL' | 'DENY_EQ', required — Permission type controlling how access levels are granted or denied. ALLOW_LT_EQ grants specified level and all lower levels. ALLOW_EQ grants only the exact level. DENY_ALL denies all level granted above in the table. DENY_EQ denies only the exact level.
  - `insert_above_rule_id` string — Optional. ID of an existing rule to insert this rule above (lower evaluation_order). If not provided, the rule is added at the top (highest evaluation_order/priority).

## Response `204`

Request completed successfully

## Other responses

- `400` — Invalid path pattern
- `404` — The specified resource was not found
- `default` — An error occurred

---

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