|
| 1 | +--- |
| 2 | +kind:change |
| 3 | +title:More flexible options for listing repositories |
| 4 | +created_at:2015-07-22 |
| 5 | +author_name:jakeboxer |
| 6 | +--- |
| 7 | + |
| 8 | +We're offering an improved way to filter the repositories returned by the[List your repositories][list-your-repos] API. We've added two new parameters that supercede the old`type` parameter:`visibility` and`affiliation`. |
| 9 | + |
| 10 | +The`visibility` parameter filters repositories by their visibility. It defaults to`"all"`, but you can pass`"public"` or`"private"` to only list public or private repositories (respectively). |
| 11 | + |
| 12 | +The`affiliation` parameter filters repositories by how they're affiliated with the authenticated user. You can choose from three different affiliations: |
| 13 | + |
| 14 | +- If you pass`"owner"`, you'll include repositories that are owned by the authenticated user. |
| 15 | +- If you pass`"collaborator"`, you'll include repositories that the authenticated user has been added as a collaborator to. |
| 16 | +- If you pass`"organization_member"`, you'll include repositories that the authenticated user has access to through an organization membership. For example, this will include all repositories that have been added to teams the authenticated user is on. |
| 17 | + |
| 18 | +If you want to include repositories that span multiple types of affiliation, you can pass a comma-separated string. For example, if you want a list of all the repositories that the user owns or is a collaborator on, you can pass`affiliation=owner,collaborator`. If no`affiliation` parameter is passed, it defaults to`affiliation=owner,collaborator,organization_member`. |
| 19 | + |
| 20 | +The`type` parameter will continue to function as normal, but if you'd like to learn how to take advantage of these new parameters, check out[the API documentation][list-your-repos]. |
| 21 | + |
| 22 | +If you have any questions or feedback, please[get in touch with us][contact]! |
| 23 | + |
| 24 | +[list-your-repos]:/v3/repos/#list-your-repositories |
| 25 | +[contact]:https://github.com/contact?form[subject]=List+your+repositories+API |