Skip to main content

repo_permissions

Overview

Namerepo_permissions
TypeResource
Idgithub.teams.repo_permissions

Fields

NameDatatypeDescription
idintegerUnique identifier of the repository
namestringThe name of the repository.
descriptionstring
allow_auto_mergebooleanWhether to allow Auto-merge to be used on pull requests.
allow_forkingbooleanWhether to allow forking this repo
allow_merge_commitbooleanWhether to allow merge commits for pull requests.
allow_rebase_mergebooleanWhether to allow rebase merges for pull requests.
allow_squash_mergebooleanWhether to allow squash merges for pull requests.
archive_urlstring
archivedbooleanWhether the repository is archived.
assignees_urlstring
blobs_urlstring
branches_urlstring
clone_urlstring
collaborators_urlstring
comments_urlstring
commits_urlstring
compare_urlstring
contents_urlstring
contributors_urlstring
created_atstring
default_branchstringThe default branch of the repository.
delete_branch_on_mergebooleanWhether to delete head branches when pull requests are merged
deployments_urlstring
disabledbooleanReturns whether or not this repository disabled.
downloads_urlstring
events_urlstring
forkboolean
forksinteger
forks_countinteger
forks_urlstring
full_namestring
git_commits_urlstring
git_refs_urlstring
git_tags_urlstring
git_urlstring
has_downloadsbooleanWhether downloads are enabled.
has_issuesbooleanWhether issues are enabled.
has_pagesboolean
has_projectsbooleanWhether projects are enabled.
has_wikibooleanWhether the wiki is enabled.
homepagestring
hooks_urlstring
html_urlstring
is_templatebooleanWhether this repository acts as a template that can be used to generate new repositories.
issue_comment_urlstring
issue_events_urlstring
issues_urlstring
keys_urlstring
labels_urlstring
languagestring
languages_urlstring
licenseobjectLicense Simple
master_branchstring
merges_urlstring
milestones_urlstring
mirror_urlstring
network_countinteger
node_idstring
notifications_urlstring
open_issuesinteger
open_issues_countinteger
ownerobjectA GitHub user.
permissionsobject
privatebooleanWhether the repository is private or public.
pulls_urlstring
pushed_atstring
releases_urlstring
role_namestring
sizeinteger
ssh_urlstring
stargazers_countinteger
stargazers_urlstring
statuses_urlstring
subscribers_countinteger
subscribers_urlstring
subscription_urlstring
svn_urlstring
tags_urlstring
teams_urlstring
temp_clone_tokenstring
template_repositoryobjectA repository on GitHub.
topicsarray
trees_urlstring
updated_atstring
urlstring
visibilitystringThe repository visibility: public, private, or internal.
watchersinteger
watchers_countinteger
web_commit_signoff_requiredbooleanWhether to require contributors to sign off on web-based commits

Methods

NameAccessible byRequired ParamsDescription
check_permissions_for_repo_in_orgSELECTorg, owner, repo, team_slugChecks whether a team has admin, push, maintain, triage, or pull permission for a repository. Repositories inherited through a parent team will also be checked.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the application/vnd.github.v3.repository+json accept header.

If a team doesn't have permission for the repository, you will receive a 404 Not Found response status.

Note: You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.
check_permissions_for_repo_legacySELECTowner, repo, team_idNote: Repositories inherited through a parent team will also be checked.

Deprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new Check team permissions for a repository endpoint.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the Accept header:
add_or_update_repo_permissions_in_orgEXECorg, owner, repo, team_slugTo add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

Note: You can also specify a team by org_id and team_id using the route PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.

For more information about the permission levels, see "Repository permission levels for an organization".
add_or_update_repo_permissions_legacyEXECowner, repo, team_idDeprecation Notice: This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "Add or update team repository permissions" endpoint.

To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity status if you attempt to add a repository to a team that is not owned by the organization.

Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."