Skip to main content

repos

Overview

Namerepos
TypeResource
Idgithub.repos.repos

Fields

NameDatatypeDescription
idinteger
namestring
descriptionstring
allow_forkingboolean
archive_urlstring
archivedboolean
assignees_urlstring
blobs_urlstring
branches_urlstring
clone_urlstring
code_of_conductobjectCode Of Conduct
collaborators_urlstring
comments_urlstring
commits_urlstring
compare_urlstring
contents_urlstring
contributors_urlstring
created_atstring
default_branchstring
delete_branch_on_mergeboolean
deployments_urlstring
disabledboolean
downloads_urlstring
events_urlstring
forkboolean
forksinteger
forks_countinteger
forks_urlstring
full_namestring
git_commits_urlstring
git_refs_urlstring
git_tags_urlstring
git_urlstring
has_discussionsboolean
has_downloadsboolean
has_issuesboolean
has_pagesboolean
has_projectsboolean
has_wikiboolean
homepagestring
hooks_urlstring
html_urlstring
is_templateboolean
issue_comment_urlstring
issue_events_urlstring
issues_urlstring
keys_urlstring
labels_urlstring
languagestring
languages_urlstring
licenseobject
merges_urlstring
milestones_urlstring
mirror_urlstring
network_countinteger
node_idstring
notifications_urlstring
open_issuesinteger
open_issues_countinteger
ownerobjectA GitHub user.
permissionsobject
privateboolean
pulls_urlstring
pushed_atstring
releases_urlstring
role_namestring
security_and_analysisobject
sizeintegerThe size of the repository. Size is calculated hourly. When a repository is initially created, the size is 0.
ssh_urlstring
stargazers_countinteger
stargazers_urlstring
statuses_urlstring
subscribers_countinteger
subscribers_urlstring
subscription_urlstring
svn_urlstring
tags_urlstring
teams_urlstring
temp_clone_tokenstring
topicsarray
trees_urlstring
updated_atstring
urlstring
visibilitystring
watchersinteger
watchers_countinteger
web_commit_signoff_requiredboolean

Methods

NameAccessible byRequired ParamsDescription
list_for_orgSELECTorgLists repositories for the specified organization.

Note: In order to see the security_and_analysis block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "Managing security managers in your organization."
list_for_userSELECTusernameLists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user.
list_publicSELECTLists all public repositories in the order that they were created.

Note:
- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.
- Pagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of repositories.
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
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 read 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.
create_using_templateEXECtemplate_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. If the repository is not public, 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
disable_private_vulnerability_reportingEXECowner, repoDisables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "Privately reporting a security vulnerability".
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_private_vulnerability_reportingEXECowner, repoEnables private vulnerability reporting for a repository. The authenticated user must have admin access to the repository. For more information, see "Privately reporting a security vulnerability."
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".
list_languagesEXECowner, repoLists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language.
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.
You must use a personal access token (classic) or an OAuth token for this endpoint. An installation access token or a fine-grained personal access token cannot be used because they are only granted access to a single account.
updateEXECowner, repoNote: To edit a repository's topics, use the Replace all repository topics endpoint.