The name of the branch.
Set team access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.
Type | Description |
---|---|
array |
The teams that can have push access. Use the team’s slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
Path Parameters
Body
application/json
Body
One Of
teams parameter
Response
application/json
Response
Response
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Example:https://github.com/orgs/rails/teams/core
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Path Parameters
Body
Remove team access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Removes the ability of a team to push to this branch. You can also remove push access for child teams.
Type | Description |
---|---|
array |
Teams that should no longer have push access. Use the team’s slug . Note: The list of users, apps, and teams in total is limited to 100 items. |
Path Parameters
The name of the branch.
Body
application/json
Body
One Of
teams parameter
Response
application/json
Response
Response
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Example:https://github.com/orgs/rails/teams/core
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Path Parameters
Body
Get users with access to the protected branch
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Lists the people who have push access to this branch.
Path Parameters
The name of the branch.
Response
application/json
Response
Response
Simple User
Example:octocat
Example:1
Example:MDQ6VXNlcjE=
Example:https://github.com/images/error/octocat_happy.gif
Example:41d064eb2195891e12d0413f63227ea7
Example:https://api.github.com/users/octocat
Example:https://github.com/octocat
Example:https://api.github.com/users/octocat/followers
Example:https://api.github.com/users/octocat/following{/other_user}
Example:https://api.github.com/users/octocat/gists{/gist_id}
Example:https://api.github.com/users/octocat/starred{/owner}{/repo}
Example:https://api.github.com/users/octocat/subscriptions
Example:https://api.github.com/users/octocat/orgs
Example:https://api.github.com/users/octocat/repos
Example:https://api.github.com/users/octocat/events{/privacy}
Example:https://api.github.com/users/octocat/received_events
Example:User
Example:"2020-07-09T00:17:55Z"
Path Parameters
Add user access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Grants the specified people push access for this branch.
Type | Description |
---|---|
array |
Usernames for people who can have push access. Note: The list of users, apps, and teams in total is limited to 100 items. |
Path Parameters
The name of the branch.
Body
application/json
Body
One Of
users parameter
Response
application/json
Response
Response
Simple User
Example:octocat
Example:1
Example:MDQ6VXNlcjE=
Example:https://github.com/images/error/octocat_happy.gif
Example:41d064eb2195891e12d0413f63227ea7
Example:https://api.github.com/users/octocat
Example:https://github.com/octocat
Example:https://api.github.com/users/octocat/followers
Example:https://api.github.com/users/octocat/following{/other_user}
Example:https://api.github.com/users/octocat/gists{/gist_id}
Example:https://api.github.com/users/octocat/starred{/owner}{/repo}
Example:https://api.github.com/users/octocat/subscriptions
Example:https://api.github.com/users/octocat/orgs
Example:https://api.github.com/users/octocat/repos
Example:https://api.github.com/users/octocat/events{/privacy}
Example:https://api.github.com/users/octocat/received_events
Example:User
Example:"2020-07-09T00:17:55Z"
Path Parameters
Body
Set user access restrictions
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.
Type | Description |
---|---|
array |
Usernames for people who can have push access. Note: The list of users, apps, and teams in total is limited to 100 items. |
Path Parameters
The name of the branch.
Body
application/json
Body
One Of
users parameter
Response
application/json
Response
Response
Simple User
Example:octocat
Example:1
Example:MDQ6VXNlcjE=
Example:https://github.com/images/error/octocat_happy.gif
Example:41d064eb2195891e12d0413f63227ea7
Example:https://api.github.com/users/octocat
Example:https://github.com/octocat
Example:https://api.github.com/users/octocat/followers
Example:https://api.github.com/users/octocat/following{/other_user}
Example:https://api.github.com/users/octocat/gists{/gist_id}
Example:https://api.github.com/users/octocat/starred{/owner}{/repo}
Example:https://api.github.com/users/octocat/subscriptions
Example:https://api.github.com/users/octocat/orgs
Example:https://api.github.com/users/octocat/repos
Example:https://api.github.com/users/octocat/events{/privacy}
Example:https://api.github.com/users/octocat/received_events
Example:User
Example:"2020-07-09T00:17:55Z"