---
title: "addBranchRestriction"
canonical: "https://support.appfire.com/space/SCLI/73370881/addBranchRestriction"
format: markdown
---
See also: [Actions](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73368507)

> Macro (details)
> 
> | **Description** | Add branch level restriction with optional exemptions for users and groups. Restriction defaults to read-only. Restriction applies to branches matching by branch name, pattern, or model. Default is matching on branch name. User exceptions can be specified by the userId parameter as a common separated list of user ids. Group exceptions can be specified by the group parameter as a common separated list of group names. |
> | --- | --- |
> | **Required Parameters** | [project](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73368805), [repository](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73368867), [branch](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73370663) |
> | **Optional Parameters** | [restriction](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73371487), [matchingType](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73370597), [userId](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73368641), [group](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73370813), [replace](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73371611) |
> | **Type** | [Create](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73370540/Action+Types#ActionTypes-Create) |
> | **Category** | [Branches](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73371318/Action+Categories#ActionCategories-Branches) |
> | **Output Formats** |  |
> | **Replacement Variables** | restrictionId |
> | **Hosting** | server,datacenter |
> | **Since Version** |  |
> | **Examples** | [addBranchRestriction](https://appfire.atlassian.net/wiki/spaces/SCLI/pages/73371753/Examples#Examples-addBranchRestriction) |

## Related How To's

> Macro (cql-query)