REST API endpoints for repositories

Use the REST API to manage repositories on GitHub.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List organization repositories

GET /orgs/{org}/repos

Lists 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."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/repos

Response schema (Status: 200):

Array of Minimal Repository:

Create an organization repository

POST /orgs/{org}/repos

Creates a new repository in the specified organization. The authenticated user must be a member of the organization.
OAuth app tokens and personal access tokens (classic) need the public_repo or repo scope to create a public repository, and repo scope to create a private repository.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/orgs/ORG/repos \
  -d '{
  "name": "Hello-World",
  "description": "This is your first repository",
  "homepage": "https://github.com",
  "private": false,
  "has_issues": true,
  "has_projects": true,
  "has_wiki": true
}'

Response schema (Status: 201):

Get a repository

GET /repos/{owner}/{repo}

The 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.
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."
To view merge-related settings, you must have the contents:read and contents:write permissions.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO

Response schema (Status: 200):

Same response schema as Create an organization repository.

Update a repository

PATCH /repos/{owner}/{repo}

Note: To edit a repository's topics, use the Replace all repository topics endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PATCH \
  https://api.github.com/repos/OWNER/REPO \
  -d '{
  "name": "Hello-World",
  "description": "This is your first repository",
  "homepage": "https://github.com",
  "private": true,
  "has_issues": true,
  "has_projects": true,
  "has_wiki": true
}'

Response schema (Status: 200):

Same response schema as Create an organization repository.

Delete a repository

DELETE /repos/{owner}/{repo}

Deleting a repository requires admin access.
If an organization owner has configured the organization to prevent members from deleting organization-owned
repositories, you will get a 403 Forbidden response.
OAuth app tokens and personal access tokens (classic) need the delete_repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO

Response schema (Status: 204):

List repository activities

GET /repos/{owner}/{repo}/activity

Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.
For more information about viewing repository activity,
see "Viewing activity and data for your repository."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/activity

Response schema (Status: 200):

Array of Activity:

Check if Dependabot security updates are enabled for a repository

GET /repos/{owner}/{repo}/automated-security-fixes

Shows whether Dependabot security updates are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "Configuring Dependabot security updates".

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/automated-security-fixes

Response schema (Status: 200):

Enable Dependabot security updates

PUT /repos/{owner}/{repo}/automated-security-fixes

Enables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "Configuring Dependabot security updates".

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/automated-security-fixes

Response schema (Status: 204):

Disable Dependabot security updates

DELETE /repos/{owner}/{repo}/automated-security-fixes

Disables Dependabot security updates for a repository. The authenticated user must have admin access to the repository. For more information, see "Configuring Dependabot security updates".

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/automated-security-fixes

Response schema (Status: 204):

List CODEOWNERS errors

GET /repos/{owner}/{repo}/codeowners/errors

List any syntax errors that are detected in the CODEOWNERS
file.
For more information about the correct CODEOWNERS syntax,
see "About code owners."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/codeowners/errors

Response schema (Status: 200):

List repository contributors

GET /repos/{owner}/{repo}/contributors

Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.
GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/contributors

Response schema (Status: 200):

Array of Contributor:

Create a repository dispatch event

POST /repos/{owner}/{repo}/dispatches

You 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 input example shows how you can use the client_payload as a test to debug your workflow.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/dispatches \
  -d '{
  "event_type": "on-demand-test",
  "client_payload": {
    "unit": false,
    "integration": true
  }
}'

Response schema (Status: 204):

Get the hash algorithm for a repository

GET /repos/{owner}/{repo}/hash-algorithm

Returns the hash algorithm used to store repository objects.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/hash-algorithm

Response schema (Status: 200):

Check if immutable releases are enabled for a repository

GET /repos/{owner}/{repo}/immutable-releases

Shows whether immutable releases are enabled or disabled. Also identifies whether immutability is being
enforced by the repository owner. The authenticated user must have admin read access to the repository.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/immutable-releases

Response schema (Status: 200):

Enable immutable releases

PUT /repos/{owner}/{repo}/immutable-releases

Enables immutable releases for a repository. The authenticated user must have admin access to the repository.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/immutable-releases

Response schema (Status: 204):

Disable immutable releases

DELETE /repos/{owner}/{repo}/immutable-releases

Disables immutable releases for a repository. The authenticated user must have admin access to the repository.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/immutable-releases

Response schema (Status: 204):

List repository languages

GET /repos/{owner}/{repo}/languages

Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/languages

Response schema (Status: 200):

object, additional properties: integer

Check if private vulnerability reporting is enabled for a repository

GET /repos/{owner}/{repo}/private-vulnerability-reporting

Returns a boolean indicating whether or not private vulnerability reporting is enabled for the repository. For more information, see "Evaluating the security settings of a repository".

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/private-vulnerability-reporting

Response schema (Status: 200):

Enable private vulnerability reporting for a repository

PUT /repos/{owner}/{repo}/private-vulnerability-reporting

Enables 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."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/private-vulnerability-reporting

Response schema (Status: 204):

Disable private vulnerability reporting for a repository

DELETE /repos/{owner}/{repo}/private-vulnerability-reporting

Disables 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".

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/private-vulnerability-reporting

Response schema (Status: 204):

List repository tags

GET /repos/{owner}/{repo}/tags

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/tags

Response schema (Status: 200):

Array of Tag:

List repository teams

GET /repos/{owner}/{repo}/teams

Lists the teams that have access to the specified repository and that are also visible to the authenticated user.
For a public repository, a team is listed only if that team added the public repository explicitly.
OAuth app tokens and personal access tokens (classic) need the public_repo or repo scope to use this endpoint with a public repository, and repo scope to use this endpoint with a private repository.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/teams

Response schema (Status: 200):

Array of Team:

Get all repository topics

GET /repos/{owner}/{repo}/topics

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/topics

Response schema (Status: 200):

Replace all repository topics

PUT /repos/{owner}/{repo}/topics

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/topics \
  -d '{
  "names": [
    "octocat",
    "atom",
    "electron",
    "api"
  ]
}'

Response schema (Status: 200):

Same response schema as Get all repository topics.

Transfer a repository

POST /repos/{owner}/{repo}/transfer

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

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/transfer \
  -d '{
  "new_owner": "github",
  "team_ids": [
    12,
    345
  ],
  "new_name": "octorepo"
}'

Response schema (Status: 202):

Check if vulnerability alerts are enabled for a repository

GET /repos/{owner}/{repo}/vulnerability-alerts

Shows 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".

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/vulnerability-alerts

Response schema (Status: 204):

Enable vulnerability alerts

PUT /repos/{owner}/{repo}/vulnerability-alerts

Enables 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".

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PUT \
  https://api.github.com/repos/OWNER/REPO/vulnerability-alerts

Response schema (Status: 204):

Disable vulnerability alerts

DELETE /repos/{owner}/{repo}/vulnerability-alerts

Disables 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".

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/vulnerability-alerts

Response schema (Status: 204):

Create a repository using a template

POST /repos/{template_owner}/{template_repo}/generate

Creates 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 app tokens and personal access tokens (classic) need the public_repo or repo scope to create a public repository, and repo scope to create a private repository.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/TEMPLATE_OWNER/TEMPLATE_REPO/generate \
  -d '{
  "owner": "octocat",
  "name": "Hello-World",
  "description": "This is your first repository",
  "include_all_branches": false,
  "private": false
}'

Response schema (Status: 201):

Same response schema as Create an organization repository.

List public repositories

GET /repositories

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

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repositories

Response schema (Status: 200):

Same response schema as List organization repositories.

List repositories for the authenticated user

GET /user/repos

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

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/repos

Response schema (Status: 200):

Array of Repository:

Create a repository for the authenticated user

POST /user/repos

Creates a new repository for the authenticated user.
OAuth app tokens and personal access tokens (classic) need the public_repo or repo scope to create a public repository, and repo scope to create a private repository.

Parameters

Headers

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/user/repos \
  -d '{
  "name": "Hello-World",
  "description": "This is your first repo!",
  "homepage": "https://github.com",
  "private": false,
  "is_template": true
}'

Response schema (Status: 201):

Same response schema as Create an organization repository.

List repositories for a user

GET /users/{username}/repos

Lists public repositories for the specified user.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/users/USERNAME/repos

Response schema (Status: 200):

Same response schema as List organization repositories.