Skip to main content

repos

Overview

Namerepos
TypeResource
Idgithub.repos.repos

Fields

NameDatatypeDescription
idinteger
namestring
descriptionstring
default_branchstring
git_refs_urlstring
delete_branch_on_mergeboolean
languages_urlstring
created_atstring
commits_urlstring
tags_urlstring
subscribers_urlstring
comments_urlstring
stargazers_countinteger
svn_urlstring
assignees_urlstring
watchers_countinteger
statuses_urlstring
contributors_urlstring
role_namestring
subscription_urlstring
open_issues_countinteger
ssh_urlstring
allow_forkingboolean
pushed_atstring
homepagestring
updated_atstring
releases_urlstring
has_issuesboolean
archive_urlstring
has_pagesboolean
template_repositoryobjectA git repository
topicsarray
sizeinteger
stargazers_urlstring
compare_urlstring
disabledboolean
is_templateboolean
trees_urlstring
forkboolean
full_namestring
temp_clone_tokenstring
deployments_urlstring
subscribers_countinteger
downloads_urlstring
branches_urlstring
mirror_urlstring
collaborators_urlstring
has_projectsboolean
labels_urlstring
has_wikiboolean
events_urlstring
keys_urlstring
teams_urlstring
issue_events_urlstring
watchersinteger
hooks_urlstring
network_countinteger
issues_urlstring
blobs_urlstring
milestones_urlstring
privateboolean
issue_comment_urlstring
forksinteger
forks_countinteger
html_urlstring
permissionsobject
urlstring
node_idstring
languagestring
open_issuesinteger
git_urlstring
merges_urlstring
visibilitystring
pulls_urlstring
forks_urlstring
archivedboolean
code_of_conductobjectCode Of Conduct
notifications_urlstring
has_downloadsboolean
git_commits_urlstring
clone_urlstring
ownerobjectSimple User
licenseobject
git_tags_urlstring
contents_urlstring

Methods

NameAccessible byRequired ParamsDescription
getSELECTowner, repoThe parent and source objects are present when the repository is a fork. parent is the repository this repository was forked from, source is the ultimate source for the network.
list_for_authenticated_userSELECTLists repositories that the authenticated user has explicit permission (:read, :write, or :admin) to access.

The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
list_for_orgSELECTorgLists repositories for the specified organization.
list_for_userSELECTusernameLists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user.
create_for_authenticated_userINSERTdata__nameCreates a new repository for the authenticated user.

OAuth scope requirements

When using OAuth, authorizations must include:

public_repo scope or repo scope to create a public repository. Note: For GitHub AE, use repo scope to create an internal repository.
repo scope to create a private repository.
create_in_orgINSERTorg, data__nameCreates a new repository in the specified organization. The authenticated user must be a member of the organization.

OAuth scope requirements

When using OAuth, authorizations must include:

public_repo scope or repo scope to create a public repository. Note: For GitHub AE, use repo scope to create an internal repository.
repo scope to create a private repository
create_using_templateINSERTtemplate_owner, template_repo, data__nameCreates a new repository using a repository template. Use the template_owner and template_repo route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the Get a repository endpoint and check that the is_template key is true.

OAuth scope requirements

When using OAuth, authorizations must include:

public_repo scope or repo scope to create a public repository. Note: For GitHub AE, use repo scope to create an internal repository.
repo scope to create a private repository
deleteDELETEowner, repoDeleting a repository requires admin access. If OAuth is used, the delete_repo scope is required.

If an organization owner has configured the organization to prevent members from deleting organization-owned
repositories, you will get a 403 Forbidden response.
check_vulnerability_alertsEXECowner, repoShows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "About security alerts for vulnerable dependencies".
codeowners_errorsEXECowner, repoList any syntax errors that are detected in the CODEOWNERS
file.

For more information about the correct CODEOWNERS syntax,
see "About code owners."
create_dispatch_eventEXECowner, repo, data__event_typeYou can use this endpoint to trigger a webhook event called repository_dispatch when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the repository_dispatch event occurs. For an example repository_dispatch webhook payload, see "RepositoryDispatchEvent."

The client_payload parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the client_payload can include a message that a user would like to send using a GitHub Actions workflow. Or the client_payload can be used as a test to debug your workflow.

This endpoint requires write access to the repository by providing either:

- Personal access tokens with repo scope. For more information, see "Creating a personal access token for the command line" in the GitHub Help documentation.
- GitHub Apps with both metadata:read and contents:read&write permissions.

This input example shows how you can use the client_payload as a test to debug your workflow.
disable_automated_security_fixesEXECowner, repoDisables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "Configuring automated security fixes".
disable_vulnerability_alertsEXECowner, repoDisables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "About security alerts for vulnerable dependencies".
enable_automated_security_fixesEXECowner, repoEnables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "Configuring automated security fixes".
enable_vulnerability_alertsEXECowner, repoEnables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "About security alerts for vulnerable dependencies".
transferEXECowner, repo, data__new_ownerA transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original owner, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see about repository transfers.
updateEXECowner, repoNote: To edit a repository's topics, use the Replace all repository topics endpoint.