Sample - GitHub REST API
GET/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}

Check team permissions for a repository

Checks 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.

If the repository is private, you must have at least read permission for that repository, and your token must have the repo or admin:org scope. Otherwise, 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}.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

4 parameters
orgstringrequired
The organization name. The name is not case sensitive.
team_slugstringrequired
The slug of the team name.
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.

3 status codes
200Alternative response with repository permissions
idintegerrequired
Unique identifier of the repository
node_idstringrequired
namestringrequired
The name of the repository.
full_namestringrequired
licenseobjectrequired
License Simple
forksintegerrequired
permissionsobjectoptional
role_namestringoptional
ownerobjectrequired
A GitHub user.
privatebooleanrequired
Whether the repository is private or public.
Default:false
html_urlstringrequired
descriptionstringrequired
forkbooleanrequired
urlstringrequired
archive_urlstringrequired
assignees_urlstringrequired
blobs_urlstringrequired
branches_urlstringrequired
collaborators_urlstringrequired
comments_urlstringrequired
commits_urlstringrequired
compare_urlstringrequired
contents_urlstringrequired
contributors_urlstringrequired
deployments_urlstringrequired
downloads_urlstringrequired
events_urlstringrequired
forks_urlstringrequired
git_commits_urlstringrequired
git_refs_urlstringrequired
git_tags_urlstringrequired
git_urlstringrequired
issue_comment_urlstringrequired
issue_events_urlstringrequired
issues_urlstringrequired
keys_urlstringrequired
labels_urlstringrequired
languages_urlstringrequired
merges_urlstringrequired
milestones_urlstringrequired
notifications_urlstringrequired
pulls_urlstringrequired
releases_urlstringrequired
ssh_urlstringrequired
stargazers_urlstringrequired
statuses_urlstringrequired
subscribers_urlstringrequired
subscription_urlstringrequired
tags_urlstringrequired
teams_urlstringrequired
trees_urlstringrequired
clone_urlstringrequired
mirror_urlstringrequired
hooks_urlstringrequired
svn_urlstringrequired
homepagestringrequired
languagestringrequired
forks_countintegerrequired
stargazers_countintegerrequired
watchers_countintegerrequired
sizeintegerrequired
default_branchstringrequired
The default branch of the repository.
open_issues_countintegerrequired
is_templatebooleanoptional
Whether this repository acts as a template that can be used to generate new repositories.
Default:false
topicsarray<string>optional
has_issuesbooleanrequired
Whether issues are enabled.
Default:true
has_projectsbooleanrequired
Whether projects are enabled.
Default:true
has_wikibooleanrequired
Whether the wiki is enabled.
Default:true
has_pagesbooleanrequired
has_downloadsbooleanrequired
Whether downloads are enabled.
Default:true
archivedbooleanrequired
Whether the repository is archived.
Default:false
disabledbooleanrequired
Returns whether or not this repository disabled.
visibilitystringoptional
The repository visibility: public, private, or internal.
Default:public
pushed_atstringrequired
created_atstringrequired
updated_atstringrequired
allow_rebase_mergebooleanoptional
Whether to allow rebase merges for pull requests.
Default:true
temp_clone_tokenstringoptional
allow_squash_mergebooleanoptional
Whether to allow squash merges for pull requests.
Default:true
allow_auto_mergebooleanoptional
Whether to allow Auto-merge to be used on pull requests.
Default:false
delete_branch_on_mergebooleanoptional
Whether to delete head branches when pull requests are merged
Default:false
allow_merge_commitbooleanoptional
Whether to allow merge commits for pull requests.
Default:true
allow_forkingbooleanoptional
Whether to allow forking this repo
Default:false
web_commit_signoff_requiredbooleanoptional
Whether to require contributors to sign off on web-based commits
Default:false
subscribers_countintegeroptional
network_countintegeroptional
open_issuesintegerrequired
watchersintegerrequired
master_branchstringoptional
204Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header.
404Not Found if team does not have permission for the repository

Error handling

A 404 is returned: Not Found if team does not have permission for the repository.