Search code examples
githubrequestprivate

How to list organisation private repository via GitHub API?


I am trying to the list the private repos of the organization using GitHub API, but I am getting only the public repository as return.

Here's the URL : https://api.github.com/orgs/github/repos

Also I added the access token in the header, and also given the right scopes.

Here's the documentation: https://developer.github.com/v3/

https://developer.github.com/v3/orgs/#list-organizations-for-the-authenticated-user


Solution

  • You can Use the Github API: https://developer.github.com/v3/repos/#list-organization-repositories

    GET /orgs/:org/repos

    To access repository visibility during the preview period, you must provide a custom media type in the Accept header:

    application/vnd.github.nebula-preview+json
    

    enter image description here

    You can also add the type parameter to control the visibility:

    enter image description here