GitHub API Changes | GitHub Developer Guide
This content may be out of date. For the newest content, see the API posts on the GitHub Blog . All of GitHub's Docs are now in one place ! You can see Apps , REST API , and GraphQL API on GitHub Docs. Creating a repository dispatch event now official part of GitHub API January 22, 2020 anthonysterling The "Creating a repository dispatch event" endpoint no longer requires the everest preview. application/vnd.github.everest-preview+json For more information about this endpoint, see the " Create a repository dispatch event ." Thanks again to everyone that tried out these API features during the preview period.
Moving the teams API January 21, 2020 dbussink We are announcing a new set of endpoints in the Teams API. The new endpoints will allow us to scale and support the Teams API long-term. The Team APIs will be moving from a top-level path under /teams/:team_id to a scoped path under the organization that owns the team with a path like /organizations/:org_id/team/:team_id . In this move we also are adding support to making these APIs available under a named path as well with /orgs/:org/teams/:team_slug .
Deprecation timeline The existing API endpoints will be disabled a year from now at the earliest on February 1st 2021. What changes to make If you're already using an API endpoint under /teams/:team_id , the easiest way to update your code is to switch to the /organizations/:org_id/team/:team_id endpoint. If you're unsure what org_id to use, you can find it by retrieving the current team under /teams/:team_id . You'll find the org_id inside the organization hash as the id field in the response.
Note: The endpoint routes using organization and team id use the singular team . The plural form of the route already exists. For example, /organizations/:org_id/teams/:team_slug . Endpoints affected These endpoints are being deprecated: GET /teams/:team_id PATCH /teams/:team_id DELETE /teams/:team_id GET /teams/:team_id/teams GET /teams/:team_id/repos GET /teams/:team_id/repos/:owner/:repo PUT /teams/:team_id/repos/:owner/:repo DELETE /teams/:team_id/repos/:owner/:repo GET /teams/:team_id/projects GET /teams/:team_id/projects/:project_id PUT /teams/:team_id/projects/:project_id DELETE /teams/:team_id/projects/:project_id These are the new replacement team API endpoints: GET /orgs/:org/teams/:team_slug PATCH /orgs/:org/teams/:team_slug DELETE /orgs/:org/teams/:team_slug GET /orgs/:org/teams/:team_slug/teams GET /orgs/:org/teams/:team_slug/repos GET /orgs/:org/teams/:team_slug/repos/:owner/:repo PUT /orgs/:org/teams/:team_slug/repos/:owner/:repo DELETE /orgs/:org/teams/:team_slug/repos/:owner/:repo GET /orgs/:org/teams/:team_slug/projects GET /orgs/:org/teams/:team_slug/projects/:project_id PUT /orgs/:org/teams/:team_slug/projects/:project_id DELETE /orgs/:org/teams/:team_slug/projects/:project_id As mentioned, these new replacement team API endpoints are available both as /orgs/:org/teams/:team_slug for name based access, and as /organizations/:org_id/team/:team_id for id based access.
If you have any questions or feedback, please let us know ! Revoke GitHub Apps installation tokens with the REST API January 10, 2020 tarebyte Now you can revoke GitHub App installation tokens using the REST API. To access this new endpoint during the preview period, you must provide a custom media type in the Accept header: application/vnd.github.gambit-preview+json During the preview period, we may change aspects of these API endpoints based on developer feedback.
If we do, we will announce the changes here on the developer blog, but we will not provide any advance notice. For more information, see the " Revoke an installation access token " endpoint. The Source Import API ends preview January 8, 2020 jovel The Source Import API is now an official part of the GitHub API. To use the Source Import API, you no longer need the barred-rock preview. application/vnd.github.barred-rock-preview For more information about this API, see " Source Imports API ." Thanks again to everyone that tried out these API features during the preview period.
Several API previews graduate December 13, 2019 maxbeizer mclark There are several features that are now officially part of the GitHub REST API v3 . To use the affected API endpoints, you no longer need to pass preview headers. Before these previews graduated, you had to include preview headers as a custom media type in the Accept header to use these endpoints. Graduated previews To transfer a repository, you no longer need the Nightshade preview. application/vnd.github.nightshade-preview+json To invite users to an organization, you no longer need to use the Dazzler preview. application/vnd.github.dazzler-preview+json To access the Team Discussions API, you no longer need the Echo preview. application/vnd.github.echo-preview+json To use emoji in label names, add descriptions to labels or search for labels in a repository, you no longer need to use the Symmetra preview. application/vnd.github.symmetra-preview+json To retrieve someone's hovercard information in different contexts using the Hovercard API, you no longer need the Hagar preview. application/vnd.github.hagar-preview+json To see nested teams in your responses or use the Nested Teams API , you no longer need the Hellcat preview. application/vnd.github.hellcat-preview+json Thanks again to everyone that tried out these API features during the preview period.
API changes to support internal repository visibility December 3, 2019 iolsen Customers with an enterprise account using GitHub Enterprise Cloud and GitHub Enterprise Server 2.20+ have access to a third visibility option beyond public and private, called internal . We've made some recent API changes to support this option. Repository Creation Policy The REST v3 and GraphQL v4 APIs now support setting and retrieving granular repository creation permissions.
REST v3 API In the REST v3 API, Get an organization and Update an organization endpoints have three new fields added to the existing surtur preview: members_can_create_public_repositories members_can_create_private_repositories members_can_create_internal_repositories In Get an organization and Update an organization , the existing members_allowed_repository_creation_type field remains for backward compatibility but is deprecated and will be removed in the future.
Its return value ignores internal repositories. Values provided in the new fields while editing an organization override the existing members_allowed_repository_creation_type field. GraphL v4 API Similar changes apply to the GraphQL v4 API. The EnterpriseOwnerInfo object has three new fields indicating the policy setting for Enterprise accounts: membersCanCreatePublicRepositoriesSetting membersCanCreatePrivateRepositoriesSetting membersCanCreateInternalRepositoriesSetting These new fields coexist with the old membersCanCreateRepositoriesSetting which does not account for internal repository creation policy.
This field is now deprecated and will be removed in the future. The UpdateEnterpriseMembersCanCreateRepositoriesSetting mutation includes four new input fields: membersCanCreateRepositoriesPolicyEnabled , which toggles enterprise policy enforcement over organizations. membersCanCreatePublicRepositories membersCanCreatePrivateRepositories membersCanCreateInternalRepositories These new fields coexist with the old settingValue which does not account for internal repository creation policy.
This field is also deprecated and will be removed in the future. Repository Visibility Fields You can now set and retrieve the visibility of a repository with a new field that accommodates internal repositories, which are available to enterprise accounts using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. In the REST v3 API, you will see the following changes: These endpoints show visibility key in the response: List repositories for the authenticated user List repositories for a user List organization repositories Create a re
The rest of this page is on the live site.