Preview the Repository Traffic API
We've added an API for repository traffic, which will let you fetch details about traffic for repositories you have push access to. This data is already available in graphical form in the Graphs section on GitHub.com.
To access the Traffic API during the preview period, you must provide a custom media type in the Accept header:
application/vnd.github.spiderman-preview
During the preview period, we may change aspects of these API methods 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.
If you have any questions or feedback, please let us know!
Breaking change: Removed sensitive fields from Organization API responses for non-owners
We're removing some values from Organization API responses to help protect our users' privacy. Previously, these fields were returned to all members of the organization. As of today, you must be an Organization owner to receive values for the following fields in Organization responses:
private_gistsdisk_usagecollaboratorsbilling_email
If you're not an organization owner, the above keys will now return null.
We will continue to send these fields without their values to minimize the impact
of this change.
If you have any questions or feedback, please drop us a line.
Multiple Assignees API is now official
We're making Multiple Assignees part of the official GitHub API.
During the preview period you needed to provide the application/vnd.github.cerberus-preview preview media type in the Accept header to opt-in to the changes. Now that the preview period has ended, you no longer need to specify this custom media type.
If you have any questions or feedback, please get in touch with us!
Introducing the GitHub Pages preview API
We're introducing additional preview functionality to the GitHub Pages API to give developers better control over their GitHub Pages site.
Requesting a page build
You can now manually request a build of your GitHub Pages site without needing to push a new commit by making a POST request to the endpoint already available to see past builds. For example:
curl "https://api.github.com/repos/github/developer.github.com/pages/builds" \ -X POST -H 'Authorization: token TOKEN' \ -H "Accept: application/vnd.github.mister-fantastic-preview" \
Retrieving a site's URL
With the introduction of HTTPS support for GitHub Pages sites, it's important to know not just a site's custom domain, if it has one, but also if it has HTTPS enforcement enabled. The GitHub Pages API will now return an additional html_url field, which will include the computed absolute URL to the site.
The resulting URL can be https://username.github.io (or http://username.github.io) for user sites without a custom domain, https://username.gituhb.io/project for project sites, or http://example.com for sites with custom domains, saving third-party applications the trouble of having to construct complicated URL logic based on the username, owner, and CNAME, as was previously necessary.
For example, to request the HTML URL:
curl "https://api.github.com/repos/github/developer.github.com/pages" \ -H 'Authorization: token TOKEN' \ -H "Accept: application/vnd.github.mister-fantastic-preview" \
How can I try it?
To access this functionality during the preview period, you’ll need to provide the following custom media type in the Accept header:
application/vnd.github.mister-fantastic-preview+json
During the preview period, we may change aspects of these API methods 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, take a look at the docs here, and if you have any questions, please get in touch.
Update to Protected Branches API Preview
Over the past few months, we've made a few improvements to the way protected branches work in our web interface. Today, we're modifying the protected branches API preview period to include these improvements.
Included in these API changes is the ability to allow organizations to specify which members and teams should be able to push to a protected branch, as well as providing a new setting for required status checks which will remove the requirement of a pull request to be up to date before merging.
You'll notice a new endpoint structure. One set of endpoints for modifying the branch settings as a whole (PATCH /repos/:owner/:repo/branches/:branch has been updated to be PUT /repos/:owner/:repo/branches/:branch/protection), and a series of more granular endpoints to modify a subset of the branch protection settings.
This will be a breaking change for the protected branch API. The deprecated API endpoint will be removed when the protected branches API will leave the preview period. If you're trying out the old protected branches API, you'll need to update your code.
How can I try it?
To access this functionality during the preview period, you’ll need to provide the following custom media type in the Accept header:
application/vnd.github.loki-preview+json
Take a look at the docs here. If you have any questions, please get in touch.
Issue locking and unlocking APIs are now official
We're making the Issue locking and unlocking APIs part of the official GitHub API.
During the preview period you needed to provide the application/vnd.github.the-key-preview+json preview media type in the Accept header to opt-in to the new endpoints. Now that the preview period has ended, you no longer need to specify this custom media type.
If you have any questions or feedback, please get in touch with us!
API changes for Repository Invitations
We announced repository invitation functionality on May 23. Using the site, you can invite collaborators to work on your repository. Invitees will receive an email with the invitation and have the option to accept or decline.
We have now have endpoints for managing repository invitations for both repository administrators and invitation recipients through the GitHub API. You can enable these changes during the preview period by providing a custom media type in the Accept header:
application/vnd.github.swamp-thing-preview
For example:
curl "https://api.github.com/repos/github/hubot/invitations" \ -H 'Authorization: token TOKEN' \ -H "Accept: application/vnd.github.swamp-thing-preview"
You can learn more about the new endpoints in the updated Collaborators and new Repository Invitations documentation.
If you have any questions or feedback, please let us know.
Reactions API Preview now includes user information
To avoid making extra API calls, we've updated the Reactions API preview to include additional user information when listing Reactions.
This is a breaking change for Reaction payloads. If you're trying out this new API during its preview period, you'll need to update your code to continue working with it.
JSON Payload Changes
We're replacing the user_id attribute with user and changing the schema type from a number to a JSON object.
Example Reaction JSON
[
{
"id": 1,
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"content": "heart"
}
]
As always, if you have any questions or feedback, please get in touch.
API changes for Multiple Issue Assignees
GitHub recently added the ability to assign up to ten people to issues. We're updating Issue payloads and adding a couple new endpoints to help you build apps. You can enable these changes during the preview period by providing a custom media type in the Accept header:
application/vnd.github.cerberus-preview
For example:
curl "https://api.github.com/repos/github/hubot/issues" \ -H 'Authorization: token TOKEN' \ -H "Accept: application/vnd.github.cerberus-preview" \
The issues returned in this list will include the new assignees key.
You can learn more about the new responses and endpoints in the updated Issues and Issue Assignees documentation.
If you have any questions or feedback, please let us know!
Preview the Timeline API
We've added an API for issue timelines, which will let you fetch a list of events from an issue or pull request timeline.
To access the Timeline API during the preview period, you must provide a custom media type in the Accept header:
application/vnd.github.mockingbird-preview
During the preview period, we may change aspects of these API methods 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.
If you have any questions or feedback, please let us know!