diff --git a/CNAME b/CNAME
deleted file mode 100644
index 82c2e93c12..0000000000
--- a/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-developer.github.com
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 63fd16f7f0..f06489cd3c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,7 +1,68 @@
-Found a typo? Have an idea for improving the docs? Feel free to open a pull request and we'll get it merged as soon as we can!
+# Contributing to this repository
-If you have a specific question or issues with the API, please [let us know](https://github.com/contact).
+Use this repository to:
-## Do you work at GitHub?
+- Report bugs in the documentation.
+- Propose minor updates to content such as typo fixes or clarifications.
-If you're a GitHub employee, please take a look at [our GitHubber article](https://githubber.com/article/crafts/writing/everything-you-need-to-know-about-the-Developer-blog) for more specific information on contributing.
+If you have a specific question or issues with the API, please [let us know by contacing GitHub Support](https://github.com/contact).
+
+## API Reference Style Guide
+
+The API reference refers to most of the content under . The format of these pages is consistent:
+
+- Endpoints are introduced with an `h2` that describes the API.
+
+ For example: `## List issues for a repository`
+
+- The endpoint itself is wrapped in a codeblock. Capitalize the HTTP verb followed by the endpoint URL.
+
+ For example: `GET /repos/:owner/:repo/issues`
+
+- Introduce the parameters with an `h3`.
+
+ For example: `### Parameters`.
+
+- Write a table with three columns that describes any parameters. The three column headings are:
+ - `Name`, which identifies the name of the parameter.
+ - `Type`, which identifies the type of the parameter.
+ - `Description`, which describes the parameter. Start the description with the phrase **Required.** if it's required. If it's an optional parameter, end the description by listing the default value, if any.
+- Provide the endpoint's response. Responses are stored in the _lib/responses_ folder.
+
+Optionally, you may choose to include an example. Examples should be introduced with an `h3`, and should occur after the parameters are introduced and before the response.
+
+## Platform Guides
+
+Platform Guides refer to the content under . They are longer form content that solve a specific problem for the reader. Each guide follows a three-section pattern:
+
+- An introduction stating any minimum requirements, such as installed dependencies, as well as a description of the problem to solve.
+- A body that breaks down the solution to the problem with clear guidelines. Include code samples that are preceded with how the sample could be used.
+- A conclusion that summarizes that guide and offers next steps for any advanced topics.
+
+Please submit the full sample code for a guide to .
+
+## Versioning content
+
+Our documentation is single sourced and versioned to also apply to GitHub Enterprise users. We use [Liquid tags](https://help.shopify.com/themes/liquid/basics#tags) to include or exclude content for various builds.
+
+Each GitHub Enterprise release represent a "point in time" for the GitHub.com design and feature set. As a result, the APIs available on GitHub Enterprise are also the same APIs available on GitHub.com at the point when the new version was created. For example, if GitHub Enterprise 2.5 was released on December 15th, the APIs available to users are the same as whatever was available on December 15th. 2.5.x patch releases might introduce bug fixes and updates, but will rarely, if ever, contain brand new API endpoints.
+
+When writing API documentation, we filter sections meant just for GitHub.com using Liquid tags, like this:
+
+```
+{% if page.version == 'dotcom' %}
+
+You need to use an HTTP client which supports...
+
+{% endif %}
+```
+
+Similarly, content for GitHub Enterprise is versioned based on the release number, like this:
+
+```
+{% if page.version != 'dotcom' and page.version >= 2.2 %}
+
+If your GitHub Enterprise appliance has LDAP Sync enabled...
+
+{% endif %}
+```
diff --git a/README.md b/README.md
index 2c0b64ec11..d73feafde0 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,23 @@
# developer.github.com
-This is a GitHub API resource built with [Nanoc][nanoc].
+**NOTE: The developer.github.com website is no longer open-source.**
-All submissions are welcome. To submit a change, fork this repo, commit your changes, and send us a [pull request](http://help.github.com/send-pull-requests/).
+We have moved this repository into [our github-archive organization](https://github.com/github-archive) to signify that we are no longer accepting open-source contributions to this repository. We want to thank the hundreds of contributors for their assistance over the years.
+
+The decision to close-source the site stems from a variety of reasons:
+
+1. We actually already _have_ a close-sourced site, which is where we wrote documentation for unreleased features. We designed additional tooling to support this workflow, but updating the documentation is a process we'd like to simplify.
+2. We believe that any open-source project—be it documentation or software—ought to have dedicated maintainers. It became difficult to keep this repository open-source because it was maintained by the best efforts of a small group of people. Closing the site allows us to focus on what's important, without feeling guilty at missing reviews from open-source contributors.
+
+We think that the tooling we used to build this site is pretty interesting, so we're not getting rid of everything. We hope that what remains can be used as a source of inspiration for your own static site.
+
+If you find something that needs to be fixed, you can always [contact our terrific Support team](https://github.com/contact?form%5Bsubject%5D=Moving+developer.github.com+to+github-archive).
+
+Thank you!
+
+* * *
+
+This was the GitHub API documentation, built with [Nanoc][nanoc].
## Development
@@ -45,6 +60,16 @@ Nanoc has [some nice documentation](http://nanoc.ws/docs/tutorial/) to get you s
[nanoc]: http://nanoc.ws/
+### Enterprise
+
+To generate the `/enterprise` versions, pass in the Enterprise version to `script/server`. For example:
+
+``` sh
+$ script/server 2.6
+```
+
+Note that live reloading is not available for Enterprise documentation.
+
## Styleguide
Not sure how to structure the docs? Here's what the structure of the
@@ -122,10 +147,6 @@ of commands.
For more information, see [the reference documentation](https://github.com/gjtorikian/extended-markdown-filter#command-line-highlighting).
-## Deploy
-
-Deployments happen automatically once a PR is merged into `master`. A tool called [Publisher](https://github.com/gjtorikian/publisher) takes the `master` branch, builds it using Nanoc, and publishes the content to `gh-pages`. Thus, any commit to `master` is automatically sent over to `gh-pages`, where it's picked up and served by GitHub Pages.
-
## Licenses
The code to generate the site (everything excluding the assets, content,
diff --git a/assets/javascripts/initial.js b/assets/javascripts/initial.js
index 08467f032a..be7d49d2fd 100644
--- a/assets/javascripts/initial.js
+++ b/assets/javascripts/initial.js
@@ -1,8 +1,18 @@
// before anything happens, check if this is a versionless enterprise URL
path = window.location.pathname;
+hash = window.location.hash;
paths = path.split("/");
if (paths[1] == "enterprise" && (paths[2].length === 0 || isNaN(paths[2]))) {
paths.splice(2, 0, String({{ site.version }}));
suffix = window.location.search || window.location.hash;
window.location.href = window.location.protocol + "//" + window.location.host + paths.join("/") + suffix;
}
+if (path == "/v3/repos/" && hash == "#enabling-and-disabling-branch-protection") {
+ window.location.href = "/v3/repos/branches/#get-branch-protection";
+}
+if (path == "/v3/repos/" && hash == "#list-branches") {
+ window.location.href = "/v3/repos/branches/#list-branches";
+}
+if (path == "/v3/repos/" && hash == "#get-branch") {
+ window.location.href = "/v3/repos/branches/#get-branch";
+}
diff --git a/content/changes/2012-11-29-gitignore-templates.html b/content/changes/2012-11-29-gitignore-templates.html
index 46cb7574aa..d88d39b88f 100644
--- a/content/changes/2012-11-29-gitignore-templates.html
+++ b/content/changes/2012-11-29-gitignore-templates.html
@@ -6,7 +6,7 @@
We recently [made it easy][init-post] to initialize a repository when you create
it [via the API][repo-create]. One of the options you can pass when creating a
repository is `gitignore_template`. This value is the name of one of the
-templates from the the public [GitHub .gitignore repository][templates-repo].
+templates from the public [GitHub .gitignore repository][templates-repo].
The [Gitignore Templates API][new-api] makes it easy to list those templates:
diff --git a/content/changes/2013-02-05-changes-to-services.html b/content/changes/2013-02-05-changes-to-services.html
index dfc4f8ff4c..4ff6d6e8cd 100644
--- a/content/changes/2013-02-05-changes-to-services.html
+++ b/content/changes/2013-02-05-changes-to-services.html
@@ -28,5 +28,5 @@
core Services backend for everyone. Maintaining custom logic and libraries for
over 100 services is taking too much of this focus away.
-[codeclimate]: https://github.com/github/github-services/blob/master/lib/services/codeclimate.rb
-[cf]: https://github.com/github/github-services/blob/master/lib/services/campfire.rb
+[codeclimate]: https://github.com/github/github-services/blob/fbc0db24b8b7685b2058462181d928a5f2a0a448/lib/services/codeclimate.rb
+[cf]: https://github.com/github/github-services/blob/fbc0db24b8b7685b2058462181d928a5f2a0a448/lib/services/campfire.rb
diff --git a/content/changes/2014-03-18-paginating-method-changes.md b/content/changes/2014-03-18-paginating-method-changes.md
index 7909758b7e..9cba74b8db 100644
--- a/content/changes/2014-03-18-paginating-method-changes.md
+++ b/content/changes/2014-03-18-paginating-method-changes.md
@@ -119,7 +119,7 @@ Here's the complete list of updated methods:
[Pull Request files]: /v3/pulls/#list-pull-requests-files
[Release assets]: /v3/repos/releases/#list-assets-for-a-release
[Repository contributors]: /v3/repos/#list-contributors
-[Repository branches]: /v3/repos/#list-branches
+[Repository branches]: /v3/repos/branches/#list-branches
[Repository tags]: /v3/repos/#list-tags
[Repository teams]: /v3/repos/#list-teams
[Team members]: /v3/orgs/teams/#list-team-members
diff --git a/content/changes/2014-04-22-deprecating-beta-media-type.md b/content/changes/2014-04-22-deprecating-beta-media-type.md
index 94137ccf9c..e212e5ae0e 100644
--- a/content/changes/2014-04-22-deprecating-beta-media-type.md
+++ b/content/changes/2014-04-22-deprecating-beta-media-type.md
@@ -5,7 +5,7 @@ author_name: jasonrudolph
Now that the GitHub API is [serving the v3 media type by default][v3-default], we are deprecating the legacy [beta media type][beta].
-We will eventually remove support for the beta media type, but we have no official retirement date to annouce at the moment. When the time comes, rest assured that we'll announce the retirement with plenty of notice. In the meantime, existing API clients that rely on the beta media type should start making plans to migrate to v3. The beta media type differs from v3 in [just a few places][differences]. In most cases, migrating an application from the beta media type to the v3 media type is smooth and painless.
+We will eventually remove support for the beta media type, but we have no official retirement date to announce at the moment. When the time comes, rest assured that we'll announce the retirement with plenty of notice. In the meantime, existing API clients that rely on the beta media type should start making plans to migrate to v3. The beta media type differs from v3 in [just a few places][differences]. In most cases, migrating an application from the beta media type to the v3 media type is smooth and painless.
As always, if you have any questions, please [get in touch][contact].
diff --git a/content/changes/2014-10-21-deployment-webhook-payload-changes.md b/content/changes/2014-10-21-deployment-webhook-payload-changes.md
index b982566a20..e74d85137c 100644
--- a/content/changes/2014-10-21-deployment-webhook-payload-changes.md
+++ b/content/changes/2014-10-21-deployment-webhook-payload-changes.md
@@ -3,7 +3,7 @@ title: Deployment webhook payload changes
author_name: atmos
---
-On November 4th, 2014, we will begin sending a new format for [deployment][1] and [deployment status][2] payloads for webhooks. In the meantime we'll be running in a compatability mode that will give integrators the time needed to start taking advantage of the new format. Integrators who are working with webhooks and deployments are advised to upgrade to the new payload format to avoid service interruption.
+On November 4th, 2014, we will begin sending a new format for [deployment][1] and [deployment status][2] payloads for webhooks. In the meantime we'll be running in a compatibility mode that will give integrators the time needed to start taking advantage of the new format. Integrators who are working with webhooks and deployments are advised to upgrade to the new payload format to avoid service interruption.
This change brings the payloads for these events more inline with the responses you'd receive from the API. Instead of having deployment and deployment status attributes as top-level keys, we will now nest them under `deployment` and `deployment_status` keys. Since we're still in the [preview period][3] for the deployments API we felt it was best to correct this inconsistency now.
diff --git a/content/changes/2014-10-24-status-api-limits.md b/content/changes/2014-10-24-status-api-limits.md
index d748a17565..c58ae0ebe4 100644
--- a/content/changes/2014-10-24-status-api-limits.md
+++ b/content/changes/2014-10-24-status-api-limits.md
@@ -9,7 +9,7 @@ to 1000 per commit SHA, repository, and context.
Beginning Monday, November 3rd, we will trim existing data sets that exceed this limit, deleting the oldest
records first. Attempts to create statuses beyond that limit will result in a [validation error].
-If you have any feedback or questions, please don't hesistate to [contact] us.
+If you have any feedback or questions, please don't hesitate to [contact] us.
[statuses]: /v3/repos/statuses/
[validation error]: https://developer.github.com/v3/#client-errors
diff --git a/content/changes/2014-12-08-removing-authorizations-token.md b/content/changes/2014-12-08-removing-authorizations-token.md
index a5fb8002ac..994fe04884 100644
--- a/content/changes/2014-12-08-removing-authorizations-token.md
+++ b/content/changes/2014-12-08-removing-authorizations-token.md
@@ -5,7 +5,7 @@ author_name: ptoomey3
Since OAuth access tokens function like passwords, they should be treated with
care. Today we are making it easier to more securely work with authorizations
-via the Authorizations API. We are deprecating the use use of the `token`
+via the Authorizations API. We are deprecating the use of the `token`
attribute in the majority of the [Authorizations API](/v3/oauth_authorizations/)
responses. For the [affected APIs][authorizations-token-deprecation-notice], the
`token` attribute will soon return an empty string. To get ready for that
@@ -60,7 +60,7 @@ for the same client ID and user.
[OAuth applications listing on GitHub][app-listing].
* [Get-or-create an authorization for a specific app and fingerprint][get-or-create-for-app-fingerprint]
-is a new API that is analagous to the
+is a new API that is analogous to the
[Get-or-create an authorization for a specific app][get-or-create-for-app]
API, but adds support for the new `fingerprint` request parameter.
diff --git a/content/changes/2015-06-24-licenses-api-update.md b/content/changes/2015-06-24-licenses-api-update.md
index 67c7ffaded..26f5b340d3 100644
--- a/content/changes/2015-06-24-licenses-api-update.md
+++ b/content/changes/2015-06-24-licenses-api-update.md
@@ -9,7 +9,7 @@ Before, license information was only returned for an individual repository:
GET /repos/github/hubot
-Now, license information will also be included in reponses from endpoints that list multiple repositories, such as [List organization repositories](/v3/repos/#list-organization-repositories):
+Now, license information will also be included in responses from endpoints that list multiple repositories, such as [List organization repositories](/v3/repos/#list-organization-repositories):
GET /orgs/github/repos
diff --git a/content/changes/2015-11-11-protected-branches-api.md b/content/changes/2015-11-11-protected-branches-api.md
index 3510ed9866..6b09f0ac9b 100644
--- a/content/changes/2015-11-11-protected-branches-api.md
+++ b/content/changes/2015-11-11-protected-branches-api.md
@@ -3,6 +3,8 @@ title: Protected Branches API Preview Period
author_name: nakajima
---
+**UPDATE (2016-06-27):** As [announced](/changes/2016-06-27-protected-branches-api-update/), there is an extended version of the protected branches API available. This older version will be removed once the new one becomes official.
+
We're starting a preview period for the [protected branches](https://github.com/blog/2051-protected-branches-and-required-status-checks) API. Protecting a branch prevents force-pushes to it as well as deleting it. You can also specify required status checks that are required to merge code into the branch.
To protect a branch, make a `PATCH` request to the URL of the branch:
@@ -33,6 +35,6 @@ To access this functionality during the preview period, you’ll need to provide
application/vnd.github.loki-preview+json
```
-Take a look at [the docs here](/v3/repos/#enabling-and-disabling-branch-protection).
+Take a look at [the docs here](/v3/repos/branches/).
If you have any questions, please [get in touch](https://github.com/contact?form%5Bsubject%5D=Protected+Branches+API+Preview).
diff --git a/content/changes/2016-02-19-source-import-preview-api.md b/content/changes/2016-02-19-source-import-preview-api.md
index 58e2a4eee8..1caf3c446e 100644
--- a/content/changes/2016-02-19-source-import-preview-api.md
+++ b/content/changes/2016-02-19-source-import-preview-api.md
@@ -3,7 +3,7 @@ title: Preview the Source Import API
author_name: spraints
---
-We've added an API for source imports, which will let you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as [the GitHub Importer](https://import.github.com/).
+We've added an API for source imports, which will let you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as [the GitHub Importer](https://help.github.com/articles/importing-from-other-version-control-systems-to-github/).
To access [the Source Import API][docs] during the preview period, you must provide a custom [media type][media-type] in the `Accept` header:
diff --git a/content/changes/2016-05-23-timeline-preview-api.md b/content/changes/2016-05-23-timeline-preview-api.md
new file mode 100644
index 0000000000..2400991a20
--- /dev/null
+++ b/content/changes/2016-05-23-timeline-preview-api.md
@@ -0,0 +1,19 @@
+---
+title: Preview the Timeline API
+author_name: nickh
+---
+
+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][docs] during the preview period, you must provide a custom [media type][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][contact]!
+
+[media-type]: /v3/media
+[docs]: /v3/issues/timeline/
+[contact]: https://github.com/contact?form%5Bsubject%5D=Timeline+API
diff --git a/content/changes/2016-06-07-reactions-api-update.md b/content/changes/2016-06-07-reactions-api-update.md
new file mode 100644
index 0000000000..017d189394
--- /dev/null
+++ b/content/changes/2016-06-07-reactions-api-update.md
@@ -0,0 +1,46 @@
+---
+title: Reactions API Preview now includes user information
+author_name: kneemer
+---
+
+To avoid making extra API calls, we've updated the [Reactions API preview][initial-reaction-api-post] 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
+```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][contact].
+
+[initial-reaction-api-post]: /changes/2016-05-12-reactions-api-preview
+[contact]: https://github.com/contact?form%5Bsubject%5D=Reactions+API+Preview
diff --git a/content/changes/2016-06-14-repository-invitations.md b/content/changes/2016-06-14-repository-invitations.md
new file mode 100644
index 0000000000..00cddde89d
--- /dev/null
+++ b/content/changes/2016-06-14-repository-invitations.md
@@ -0,0 +1,28 @@
+---
+title: API changes for Repository Invitations
+author_name: CoralineAda
+---
+
+We announced [repository invitation functionality][repo-invitations-announcement] 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][media-type] in the `Accept` header:
+
+ application/vnd.github.swamp-thing-preview
+
+For example:
+
+``` command-line
+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][collaborators] and new [Repository Invitations][repo-invitations] documentation.
+
+If you have any questions or feedback, please [let us know][contact].
+
+[media-type]: /v3/media
+[collaborators]: /v3/repos/collaborators
+[repo-invitations]: /v3/repos/invitations
+[repo-invitations-announcement]: https://github.com/blog/2170-repository-invitations
+[contact]: https://github.com/contact?form%5Bsubject%5D=Repository+Invitations+API+Preview
diff --git a/content/changes/2016-06-22-issue-locking-api-is-now-official.md b/content/changes/2016-06-22-issue-locking-api-is-now-official.md
new file mode 100644
index 0000000000..81fb174003
--- /dev/null
+++ b/content/changes/2016-06-22-issue-locking-api-is-now-official.md
@@ -0,0 +1,14 @@
+---
+title: Issue locking and unlocking APIs are now official
+author_name: davidcelis
+---
+
+We're making the [Issue locking and unlocking APIs][issue-locking-blog-post] 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][custom-media-types].
+
+If you have any questions or feedback, please [get in touch with us][contact]!
+
+[issue-locking-blog-post]: /changes/2016-02-11-issue-locking-api/
+[custom-media-types]: /v3/media/
+[contact]: https://github.com/contact?form[subject]=Issue+Locking+and+Unlocking+API
diff --git a/content/changes/2016-06-27-protected-branches-api-update.md b/content/changes/2016-06-27-protected-branches-api-update.md
new file mode 100644
index 0000000000..6ce7053298
--- /dev/null
+++ b/content/changes/2016-06-27-protected-branches-api-update.md
@@ -0,0 +1,22 @@
+---
+title: Update to Protected Branches API Preview
+author_name: tma
+---
+
+Over the past few months, we've made a few [improvements](https://github.com/blog/2137-protected-branches-improvements) to the way [protected branches](https://github.com/blog/2051-protected-branches-and-required-status-checks) work in our web interface. Today, we're modifying the protected branches API [preview period](https://developer.github.com/changes/2015-11-11-protected-branches-api/) 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](/v3/repos/branches/). If you have any questions, please [get in touch](https://github.com/contact?form%5Bsubject%5D=Protected+Branches+API+Preview).
diff --git a/content/changes/2016-07-06-github-pages-preview-api.md b/content/changes/2016-07-06-github-pages-preview-api.md
new file mode 100644
index 0000000000..ab14cbee46
--- /dev/null
+++ b/content/changes/2016-07-06-github-pages-preview-api.md
@@ -0,0 +1,43 @@
+---
+title: Introducing the GitHub Pages preview API
+author_name: benbalter
+---
+
+We're introducing additional preview functionality to the [GitHub Pages API](/v3/repos/pages/) 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:
+
+``` command-line
+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](https://github.com/blog/2186-https-for-github-pages), 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:
+
+``` command-line
+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](/v3/repos/pages/), and if you have any questions, please [get in touch](https://github.com/contact?form%5Bsubject%5D=GitHub+Pages+API+Preview).
diff --git a/content/changes/2016-07-12-ending-multiple-assignees-preview-period.md b/content/changes/2016-07-12-ending-multiple-assignees-preview-period.md
new file mode 100644
index 0000000000..13f6fc318b
--- /dev/null
+++ b/content/changes/2016-07-12-ending-multiple-assignees-preview-period.md
@@ -0,0 +1,13 @@
+---
+title: Multiple Assignees API is now official
+author_name: nakajima
+---
+
+We're making [Multiple Assignees][blog-post] 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][contact]!
+
+[blog-post]: /changes/2016-5-27-multiple-assignees/
+[contact]: https://github.com/contact?form[subject]=Multiple+Assignees+API
diff --git a/content/changes/2016-08-09-breaking-change-removed-sensitive-fields-from-organization-api-responses-for-owner.md b/content/changes/2016-08-09-breaking-change-removed-sensitive-fields-from-organization-api-responses-for-owner.md
new file mode 100644
index 0000000000..22f0e9cd3c
--- /dev/null
+++ b/content/changes/2016-08-09-breaking-change-removed-sensitive-fields-from-organization-api-responses-for-owner.md
@@ -0,0 +1,22 @@
+---
+title: "Breaking change: Removed sensitive fields from Organization API responses for non-owners"
+author_name: kdaigle
+---
+
+We're removing some values from [Organization API](https://developer.github.com/v3/orgs/) 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_gists`
+* `disk_usage`
+* `collaborators`
+* `billing_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][contact].
+
+[contact]: https://github.com/contact?form[subject]=Removed+sensitive+fields+from+org+api
diff --git a/content/changes/2016-08-15-traffic-api-preview.md b/content/changes/2016-08-15-traffic-api-preview.md
new file mode 100644
index 0000000000..60b089e380
--- /dev/null
+++ b/content/changes/2016-08-15-traffic-api-preview.md
@@ -0,0 +1,18 @@
+---
+title: Preview the Repository Traffic API
+author_name: shreyasjoshis
+---
+
+ 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](https://help.github.com/articles/about-repository-graphs/#traffic) on GitHub.com.
+
+To access [the Traffic API][docs] during the preview period, you must provide a custom [media type][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][contact]!
+
+[media-type]: /v3/media
+[docs]: /v3/repos/traffic/
+[contact]: https://github.com/contact?form%5Bsubject%5D=Traffic+API
diff --git a/content/changes/2016-08-23-change-base.md b/content/changes/2016-08-23-change-base.md
new file mode 100644
index 0000000000..a83f67b8e3
--- /dev/null
+++ b/content/changes/2016-08-23-change-base.md
@@ -0,0 +1,25 @@
+---
+title: API changes for changing the base branch on Pull Requests
+author_name: scottjg
+---
+GitHub recently added the ability to [change the base branch][blog post] on a Pull Request after it's created. Now we're updating the Pull Request API to enable the new functionality.
+
+For example:
+
+``` command-line
+curl "https://api.github.com/repos/github/hubot/pulls/123" \
+ -H 'Authorization: token TOKEN' \
+ -d '{ "base": "master" }'
+```
+
+The Pull Request base will be updated to point to the master branch.
+
+You can learn more about the new responses and endpoints in the updated [Pull Request][pulls] documentation.
+
+If you have any questions or feedback, please [let us know][contact]!
+
+
+[pulls]: /v3/pulls
+[blog post]: https://github.com/blog/2224-change-the-base-branch-of-a-pull-request
+[contact]: https://github.com/contact?form%5Bsubject%5D=Change+base+on+Pull+Requests
+
diff --git a/content/changes/2016-5-27-multiple-assignees.md b/content/changes/2016-5-27-multiple-assignees.md
new file mode 100644
index 0000000000..1a9c70fbb0
--- /dev/null
+++ b/content/changes/2016-5-27-multiple-assignees.md
@@ -0,0 +1,28 @@
+---
+title: API changes for Multiple Issue Assignees
+author_name: nakajima
+---
+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][media-type] in the `Accept` header:
+
+ application/vnd.github.cerberus-preview
+
+For example:
+
+``` command-line
+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][issues] and [Issue Assignees][issue-assignees] documentation.
+
+If you have any questions or feedback, please [let us know][contact]!
+
+
+[media-type]: /v3/media
+[issues]: /v3/issues
+[issue-assignees]: /v3/issues/assignees
+[contact]: https://github.com/contact?form%5Bsubject%5D=Multiple+Assignees+API
+
diff --git a/content/guides/basics-of-authentication.md b/content/guides/basics-of-authentication.md
index 180f1a3ccd..f67f9e8f0e 100644
--- a/content/guides/basics-of-authentication.md
+++ b/content/guides/basics-of-authentication.md
@@ -65,7 +65,7 @@ Next, in _views/index.erb_, paste this content:
We're going to now talk to the GitHub API. Ready?
- Click here to begin!
+ Click here to begin!
If that link doesn't work, remember to provide your own Client ID!
diff --git a/content/guides/building-a-ci-server.md b/content/guides/building-a-ci-server.md
index 653c046991..be7373dc57 100644
--- a/content/guides/building-a-ci-server.md
+++ b/content/guides/building-a-ci-server.md
@@ -158,7 +158,7 @@ At GitHub, we:
All of this communication is funneled back to our chat rooms. You don't need to
build your own CI setup to use this example.
-You can always rely on [third-party services][integrations].
+You can always rely on [GitHub integrations][integrations].
[deploy API]: /v3/repos/deployments/
[status API]: /v3/repos/statuses/
diff --git a/content/guides/delivering-deployments.md b/content/guides/delivering-deployments.md
index 04566ab122..8644ae2d2f 100644
--- a/content/guides/delivering-deployments.md
+++ b/content/guides/delivering-deployments.md
@@ -14,9 +14,9 @@ the moment your code lands on `master`.
This guide will use that API to demonstrate a setup that you can use.
In our scenario, we will:
-* Merge a Pull Request
-* When the CI is finished, we'll set the Pull Request's status accordingly.
-* When the Pull Request is merged, we'll run our deployment to our server.
+* Merge a pull request
+* When the CI is finished, we'll set the pull request's status accordingly.
+* When the pull request is merged, we'll run our deployment to our server.
Our CI system and host server will be figments of our imagination. They could be
Heroku, Amazon, or something else entirely. The crux of this guide will be setting up
@@ -50,7 +50,7 @@ Start this server up. By default, Sinatra starts on port `4567`, so you'll want
to configure ngrok to start listening for that, too.
In order for this server to work, we'll need to set a repository up with a webhook.
-The webhook should be configured to fire whenever a Pull Request is created, or merged.
+The webhook should be configured to fire whenever a pull request is created, or merged.
Go ahead and create a repository you're comfortable playing around in. Might we
suggest [@octocat's Spoon/Knife repository](https://github.com/octocat/Spoon-Knife)?
After that, you'll create a new webhook in your repository, feeding it the URL
@@ -67,7 +67,7 @@ Great! Click on **Let me select individual events.**, and select the following:
* Pull Request
These are the events {{ site.data.variables.product.product_name }} will send to our server whenever the relevant action
-occurs. We'll configure our server to *just* handle when Pull Requests are merged
+occurs. We'll configure our server to *just* handle when pull requests are merged
right now:
``` ruby
@@ -125,7 +125,7 @@ Deployments can have some metadata attached to them, in the form of a `payload`
and a `description`. Although these values are optional, it's helpful to use
for logging and representing information.
-When a new deployment is created, a completely separate event is trigged. That's
+When a new deployment is created, a completely separate event is triggered. That's
why we have a new `switch` case in the event handler for `deployment`. You can
use this information to be notified when a deployment has been triggered.
@@ -138,7 +138,7 @@ the output. First, let's complete our `process_deployment` method:
``` ruby
def process_deployment
payload = JSON.parse(@payload['payload'])
- # you can send this information to your chat room, monitor, pager, e.t.c.
+ # you can send this information to your chat room, monitor, pager, etc.
puts "Processing '#{@payload['description']}' for #{payload['deploy_user']} to #{payload['environment']}"
sleep 2 # simulate work
@client.create_deployment_status("repos/#{@payload['repository']['full_name']}/deployments/#{@payload['id']}", 'pending')
@@ -175,7 +175,7 @@ server we've built above. At GitHub, we:
* In the meantime, Heaven also notifies everyone about the build, via [Hubot][hubot] sitting in our chat rooms
That's it! You don't need to build your own deployment setup to use this example.
-You can always rely on [third-party services][integrations].
+You can always rely on [GitHub integrations][integrations].
[deploy API]: /v3/repos/deployments/
[status API]: /guides/building-a-ci-server
diff --git a/content/guides/traversing-with-pagination.md b/content/guides/traversing-with-pagination.md
index 498f9b2c82..ff4d11cf0b 100644
--- a/content/guides/traversing-with-pagination.md
+++ b/content/guides/traversing-with-pagination.md
@@ -241,7 +241,7 @@ clicked_results = client.search_code('addClass user:mozilla', :page => random_pa
```
If we wanted to get fancy, we could also grab the previous and next pages, in
-order to generate links for back (`<<`) and foward (`>>`) elements:
+order to generate links for back (`<<`) and forward (`>>`) elements:
``` ruby
prev_page_href = client.last_response.rels[:prev] ? client.last_response.rels[:prev].href : "(none)"
diff --git a/content/integrations-directory/getting-listed.md b/content/integrations-directory/getting-listed.md
index 907a9088c0..7a96f11057 100644
--- a/content/integrations-directory/getting-listed.md
+++ b/content/integrations-directory/getting-listed.md
@@ -37,11 +37,7 @@ marketing site. As your product changes, keep your Integration Directory listing
### Provide categories for your listing
-Help GitHub users find your integration faster with the appropriate categories. Please send us your suggested categories for the listing. We reserve the right to remove categories from a listing, but we won't add any categories without your approval. Currently, the following categories are available:
-
-* Code
-* Collaborate
-* Ship
+Help GitHub users find your integration faster with the appropriate categories. Please send us your suggested categories for the listing from those available in the [Integrations Directory](https://github.com/integrations). If you don't see a category that fits quite right, just let us know. We reserve the right to change categories associated with the listing. If we do so, we'll do our best to keep you informed.
If your integration supports both GitHub.com and GitHub Enterprise, please let us know.
diff --git a/content/v3.md b/content/v3.md
index 916d387e63..a387737d67 100644
--- a/content/v3.md
+++ b/content/v3.md
@@ -32,9 +32,11 @@ $ curl -i {{ site.data.variables.product.api_url_pre }}/users/octocat/orgs
> Status: 200 OK
> ETag: "a00049ba79152d03380c34652f2cb612"
> X-GitHub-Media-Type: github.v3
+{% if page.version == 'dotcom' %}
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4987
> X-RateLimit-Reset: 1350085394
+{% endif %}
> Content-Length: 5
> Cache-Control: max-age=0, private, must-revalidate
> X-Content-Type-Options: nosniff
@@ -482,9 +484,19 @@ $ curl -iH 'User-Agent: ' {{ site.data.variables.product.api_url_pre }}/meta
Most responses return an `ETag` header. Many responses also return a `Last-Modified` header. You can use the values
of these headers to make subsequent requests to those resources using the
`If-None-Match` and `If-Modified-Since` headers, respectively. If the resource
-has not changed, the server will return a `304 Not Modified`. Also note: making
-a conditional request and receiving a 304 response does not count against your
-[Rate Limit](#rate-limiting), so we encourage you to use it whenever possible.
+has not changed, the server will return a `304 Not Modified`.
+
+{% if page.version == 'dotcom' %}
+
+{{#tip}}
+
+**Note**: Making a conditional request and receiving a 304 response does not
+count against your [Rate Limit](#rate-limiting), so we encourage you to use it
+whenever possible.
+
+{{/tip}}
+
+{% endif %}
``` command-line
$ curl -i {{ site.data.variables.product.api_url_pre }}/user
@@ -494,9 +506,11 @@ $ curl -i {{ site.data.variables.product.api_url_pre }}/user
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 200 OK
> Vary: Accept, Authorization, Cookie
+{% if page.version == 'dotcom' %}
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
> X-RateLimit-Reset: 1372700873
+{% endif %}
$ curl -i {{ site.data.variables.product.api_url_pre }}/user -H 'If-None-Match: "644b5b0155e6404a9cc4bd9d8b1ae730"'
> HTTP/1.1 304 Not Modified
@@ -505,9 +519,11 @@ $ curl -i {{ site.data.variables.product.api_url_pre }}/user -H 'If-None-Match:
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
+{% if page.version == 'dotcom' %}
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
> X-RateLimit-Reset: 1372700873
+{% endif %}
$ curl -i {{ site.data.variables.product.api_url_pre }}/user -H "If-Modified-Since: Thu, 05 Jul 2012 15:31:30 GMT"
> HTTP/1.1 304 Not Modified
@@ -515,9 +531,11 @@ $ curl -i {{ site.data.variables.product.api_url_pre }}/user -H "If-Modified-Sin
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
> Status: 304 Not Modified
> Vary: Accept, Authorization, Cookie
+{% if page.version == 'dotcom' %}
> X-RateLimit-Limit: 5000
> X-RateLimit-Remaining: 4996
> X-RateLimit-Reset: 1372700873
+{% endif %}
```
## Cross Origin Resource Sharing
@@ -535,7 +553,7 @@ Here's a sample request sent from a browser hitting
$ curl -i {{ site.data.variables.product.api_url_pre }} -H "Origin: http://example.com"
HTTP/1.1 302 Found
Access-Control-Allow-Origin: *
-Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
+Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, {% if page.version == 'dotcom' %}X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,{% endif %} X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Credentials: true
```
@@ -547,7 +565,7 @@ HTTP/1.1 204 No Content
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-GitHub-OTP, X-Requested-With
Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE
-Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
+Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, {% if page.version == 'dotcom' %}X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,{% endif %} X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
```
@@ -566,9 +584,11 @@ $ curl https://api.github.com?callback=foo
> /**/foo({
> "meta": {
> "status": 200,
+{% if page.version == 'dotcom' %}
> "X-RateLimit-Limit": "5000",
> "X-RateLimit-Remaining": "4966",
> "X-RateLimit-Reset": "1372700873",
+{% endif %}
> "Link": [ // pagination headers and other links
> ["https://api.github.com?page=2", {"rel": "next"}]
> ]
diff --git a/content/v3/enterprise/pre_receive_environments.md b/content/v3/enterprise/pre_receive_environments.md
new file mode 100644
index 0000000000..ac12fe2409
--- /dev/null
+++ b/content/v3/enterprise/pre_receive_environments.md
@@ -0,0 +1,193 @@
+---
+title: Pre-receive Environments
+---
+
+# Pre-receive Environments
+
+{{#tip}}
+
+
+
+ APIs for managing pre-receive hooks are currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.eye-scream-preview
+
+{{/tip}}
+
+{:toc}
+
+The Pre-receive Environments API allows you to create, list, update and delete environments for pre-receive hooks. *It is only available to [authenticated](/v3/#authentication) site administrators.* Normal users will receive a `404` response if they try to access it.
+
+Prefix all the endpoints for this API with the following URL:
+
+``` command-line
+http(s)://hostname/api/v3
+```
+
+## Object attributes
+
+### Pre-receive Environment
+
+| Name | Type | Description |
+|-----------------------|-----------|----------------------------------------------------------------------------|
+| `name` | `string` | The name of the environment as displayed in the UI. |
+| `image_url` | `string` | URL to the tarball that will be downloaded and extracted. |
+| `default_environment` | `boolean` | Whether this is the default environment that ships with GitHub Enterprise. |
+| `download` | `object` | This environment's download status. |
+| `hooks_count` | `integer` | The number of pre-receive hooks that use this environment. |
+
+### Pre-receive Environment Download
+
+| Name | Type | Description |
+|-----------------|----------|---------------------------------------------------------|
+| `state` | `string` | The state of the most recent download. |
+| `downloaded_at` | `string` | The time when the most recent download started. |
+| `message` | `string` | On failure, this will have any error messages produced. |
+
+Possible values for `state` are `not_started`, `in_progress`, `success`, `failed`.
+
+
+## Get a single pre-receive environment
+
+ GET /admin/pre-receive-environments/:id
+
+<%= headers 200 %>
+<%= json :pre_receive_environment %>
+
+## List pre-receive environments
+
+ GET /admin/pre_receive_environments
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json :pre_receive_environments %>
+
+## Create a pre-receive environment
+
+ POST /admin/pre_receive_environments
+
+### Parameters
+
+| Name | Type | Description |
+|-------------|----------|-------------------------------------------------------------------------|
+| `name` | `string` | **Required**. The new pre-receive environment's name. |
+| `image_url` | `string` | **Required**. URL from which to download a tarball of this environment. |
+
+<%= json \
+ :name => 'DevTools Hook Env',
+ :image_url => 'https://my_file_server/path/to/devtools_env.tar.gz'
+%>
+
+### Response
+
+<%= headers 201 %>
+<%= json :pre_receive_environment_create %>
+
+## Edit a pre-receive environment
+
+ PATCH /admin/pre_receive_environments/:id
+
+### Parameters
+
+| Name | Type | Description |
+|-------------|----------|-----------------------------------------------------------|
+| `name` | `string` | This pre-receive environment's new name. |
+| `image_url` | `string` | URL from which to download a tarball of this environment. |
+
+### Response
+<%= headers 200 %>
+<%= json :pre_receive_environment %>
+
+#### Client Errors
+
+If you attempt to modify the default environment, you will get a response like this:
+
+<%= headers 422 %>
+<%=
+ json :message => "Validation Failed",
+ :errors => [{
+ :resource => :PreReceiveEnvironment,
+ :code => :custom,
+ :message => 'Cannot modify or delete the default environment'
+ }]
+%>
+
+## Delete a pre-receive environment
+
+ DELETE /admin/pre_receive_environments/:id
+
+### Response
+
+<%= headers 204 %>
+
+#### Client Errors
+
+If you attempt to delete an environment that cannot be deleted, you will get a response like this:
+
+<%= headers 422 %>
+<%=
+ json :message => "Validation Failed",
+ :errors => [{
+ :resource => :PreReceiveEnvironment,
+ :code => :custom,
+ :message => 'Cannot modify or delete the default environment'
+ }]
+%>
+
+The possible error messages are:
+
+- _Cannot modify or delete the default environment_
+- _Cannot delete environment that has hooks_
+- _Cannot delete environment when download is in progress_
+
+## Get a pre-receive environment's download status
+
+In addition to seeing the download status at the `/admin/pre-receive-environments/:id`, there is also a separate endpoint for just the status.
+
+ GET /admin/pre-receive-environments/:id/downloads/latest
+
+<%= headers 200 %>
+<%= json :pre_receive_environment_download_2 %>
+
+### Object attributes
+
+| Name | Type | Description |
+|-----------------|----------|---------------------------------------------------------|
+| `state` | `string` | The state of the most recent download. |
+| `downloaded_at` | `string` | The time when the most recent download started. |
+| `message` | `string` | On failure, this will have any error messages produced. |
+
+Possible values for `state` are `not_started`, `in_progress`, `success`, `failed`.
+
+## Trigger a pre-receive environment download
+
+Triggers a new download of the environment tarball from the environment's `image_url`. When the download is finished, the newly downloaded tarball will overwrite the existing environment.
+
+ POST /admin/pre_receive_environments/:id/downloads
+
+### Response
+
+<%= headers 202 %>
+<%= json :pre_receive_environment_download %>
+
+#### Client Errors
+
+If a download cannot be triggered, you will get a reponse like this:
+
+<%= headers 422 %>
+<%=
+ json :message => "Validation Failed",
+ :errors => [{
+ :resource => :PreReceiveEnvironment,
+ :code => :custom,
+ :message => 'Can not start a new download when a download is in progress'
+ }]
+%>
+
+The possible error messages are:
+
+- _Cannot modify or delete the default environment_
+- _Can not start a new download when a download is in progress_
+
diff --git a/content/v3/enterprise/pre_receive_hooks.md b/content/v3/enterprise/pre_receive_hooks.md
new file mode 100644
index 0000000000..876f242bbd
--- /dev/null
+++ b/content/v3/enterprise/pre_receive_hooks.md
@@ -0,0 +1,110 @@
+---
+title: Pre-receive Hooks
+---
+
+# Pre-receive Hooks
+
+{{#tip}}
+
+
+
+ APIs for managing pre-receive hooks are currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.eye-scream-preview
+
+{{/tip}}
+
+{:toc}
+
+The Pre-receive Hooks API allows you to create, list, update and delete
+pre-receive hooks. *It is only available to
+[authenticated](/v3/#authentication) site administrators.* Normal users
+will receive a `404` response if they try to access it.
+
+Prefix all the endpoints for this API with the following URL:
+
+``` command-line
+http(s)://hostname/api/v3
+```
+
+## Object attributes
+
+### Pre-receive Hook
+
+| Name | Type | Description |
+|----------------------------------|-----------|-----------------------------------------------------------------|
+| `name` | `string` | The name of the hook. |
+| `script` | `string` | The script that the hook runs. |
+| `script_repository` | `object` | The GitHub repository where the script is kept. |
+| `environment` | `object` | The pre-receive environment where the script is executed. |
+| `enforcement` | `string` | The state of enforcement for this hook. |
+| `allow_downstream_configuration` | `boolean` | Whether enforcement can be overridden at the org or repo level. |
+
+Possible values for *enforcement* are `enabled`, `disabled` and`testing`. `disabled` indicates the pre-receive hook will not run. `enabled` indicates it will run and reject
+any pushes that result in a non-zero status. `testing` means the script will run but will not cause any pushes to be rejected.
+
+## Get a single pre-receive hook
+
+ GET /admin/pre-receive-hooks/:id
+
+<%= headers 200 %> <%= json :pre_receive_hook %>
+
+## List pre-receive hooks
+
+ GET /admin/pre-receive-hooks
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json :pre_receive_hooks %>
+
+## Create a pre-receive hook
+
+ POST /admin/pre-receive-hooks
+
+### Parameters
+
+| Name | Type | Description |
+|----------------------------------|-----------|----------------------------------------------------------------------------------|
+| `name` | `string` | **Required** The name of the hook. |
+| `script` | `string` | **Required** The script that the hook runs. |
+| `script_repository` | `object` | **Required** The GitHub repository where the script is kept. |
+| `environment` | `object` | **Required** The pre-receive environment where the script is executed. |
+| `enforcement` | `string` | The state of enforcement for this hook. default: `disabled` |
+| `allow_downstream_configuration` | `boolean` | Whether enforcement can be overridden at the org or repo level. default: `false` |
+
+<%= json \
+ :name => "Check Commits",
+ :script => "scripts/commit_check.sh",
+ :enforcement => "disabled",
+ :allow_downstream_configuration => false,
+ :script_repository => { :full_name => "DevIT/hooks" },
+ :environment => { :id => 2 }
+%>
+
+### Response
+<%= headers 201 %>
+<%= json :pre_receive_hook %>
+
+## Edit a pre-receive hook
+
+ PATCH /admin/pre_receive_hooks/:id
+
+<%= json \
+ :name => "Check Commits",
+ :environment => { :id => 1 },
+ :allow_downstream_configuration => true
+%>
+
+### Response
+<%= headers 200 %>
+<%= json :pre_receive_hook_update %>
+
+## Delete a pre-receive hook
+
+ DELETE /admin/pre_receive_hooks/:id
+
+### Response
+
+<%= headers 204 %>
diff --git a/content/v3/gists.md b/content/v3/gists.md
index 127940e465..0f73102306 100644
--- a/content/v3/gists.md
+++ b/content/v3/gists.md
@@ -20,7 +20,7 @@ The Gist API provides up to one megabyte of content for each file in the gist. E
If you need the full contents of the file, you can make a `GET` request to the URL specified by `raw_url`. Be aware that for files larger than ten megabytes, you'll need to clone the gist via the URL provided by `git_pull_url`.
-In addition to a specific file's contents being truncated, the entire files list may be trucated if the total number exceeds 300 files. If the top level `truncated` key is `true`, only the first 300 files have been returned in the files list. If you need to fetch all of the gist's files, you'll need to clone the gist via the URL provided by `git_pull_url`.
+In addition to a specific file's contents being truncated, the entire files list may be truncated if the total number exceeds 300 files. If the top level `truncated` key is `true`, only the first 300 files have been returned in the files list. If you need to fetch all of the gist's files, you'll need to clone the gist via the URL provided by `git_pull_url`.
## List a user's gists
@@ -48,7 +48,7 @@ Name | Type | Description
List all public gists sorted by most recently updated to least recently updated.
-Note: With pagination, you can fetch up to 200 [pages](/v3/#pagination).
+Note: With [pagination](/v3/#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.
GET /gists/public
diff --git a/content/v3/git/commits.md b/content/v3/git/commits.md
index 3287363520..69a0da52fe 100644
--- a/content/v3/git/commits.md
+++ b/content/v3/git/commits.md
@@ -72,7 +72,7 @@ Please see the [blog post](/changes/2016-04-04-git-signing-api-preview) for full
To receive signature verification data in commit objects you must provide a custom [media type](/v3/media) in the `Accept` header:
- application/vnd.github.cryptographer-preview+sha
+ application/vnd.github.cryptographer-preview
{{/tip}}
@@ -83,4 +83,35 @@ To receive signature verification data in commit objects you must provide a cust
<%= headers 200 %>
<%= json(:signed_git_commit) %>
+### The `verification` object
+
+The response will include a `verification` field whose value is an object describing the result of verifying the commit's signature. The following fields are included in the `verification` object:
+
+Name | Type | Description
+-----|------|--------------
+`verified`|`boolean` | Does GitHub consider the signature in this commit to be verified?
+`reason`|`string` | The reason for `verified` value. Possible values and their meanings are enumerated in the table below.
+`signature`|`string` | The signature that was extracted from the commit.
+`payload`|`string` | The value that was signed.
+
+#### The `reason` field
+
+The following are possible `reason`s that may be included in the `verification` object:
+
+Value | Description
+------|------------
+`expired_key` | The key that made the signature is expired.
+`not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature.
+`gpgverify_error` | There was an error communicating with the signature-verification service.
+`gpgverify_unavailable` | The signature-verification service is currently unavailable.
+`unsigned` | The object does not include a signature.
+`unknown_signature_type` | A non-PGP signature was found in the commit.
+`no_user` | No user was associated with the `committer` email address in the commit.
+`unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account.
+`bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature.
+`unknown_key` | The key that made the signature has not been registered with any user's account.
+`malformed_signature` | There was an error parsing the signature.
+`invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature.
+`valid` | None of the above errors applied, so the signature is considered to be verified.
+
{% endif %}
diff --git a/content/v3/git/tags.md b/content/v3/git/tags.md
index e19e4d6613..b0605da270 100644
--- a/content/v3/git/tags.md
+++ b/content/v3/git/tags.md
@@ -76,7 +76,7 @@ Please see the [blog post](/changes/2016-04-04-git-signing-api-preview) for full
To receive signature verification data in tag objects you must provide a custom [media type](/v3/media) in the `Accept` header:
- application/vnd.github.cryptographer-preview+sha
+ application/vnd.github.cryptographer-preview
{{/tip}}
@@ -87,5 +87,35 @@ To receive signature verification data in tag objects you must provide a custom
<%= headers 200 %>
<%= json(:signed_gittag) %>
+### The `verification` object
+
+The response will include a `verification` field whose value is an object describing the result of verifying the tag's signature. The following fields are included in the `verification` object:
+
+Name | Type | Description
+-----|------|--------------
+`verified`|`boolean` | Does GitHub consider the signature in this tag to be verified?
+`reason`|`string` | The reason for `verified` value. Possible values and their meanings are enumerated in the table below.
+`signature`|`string` | The signature that was extracted from the tag.
+`payload`|`string` | The value that was signed.
+
+#### The `reason` field
+
+The following are possible `reason`s that may be included in the `verification` object:
+
+Value | Description
+------|------------
+`expired_key` | The key that made the signature is expired.
+`not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature.
+`gpgverify_error` | There was an error communicating with the signature-verification service.
+`gpgverify_unavailable` | The signature-verification service is currently unavailable.
+`unsigned` | The object does not include a signature.
+`unkown_signature_type` | A non-PGP signature was found in the tag.
+`no_user` | No user was associated with the `tagger` email address in the tag.
+`unverified_email` | The `tagger` email address in the tag was associated with a user, but the email address is not verified on her/his account.
+`bad_email` | The `tagger` email address in the tag is not included in the identities of the PGP key that made the signature.
+`unknown_key` | The key that made the signature has not been registered with any user's account.
+`malformed_signature` | There was an error parsing the signature.
+`invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature.
+`valid` | None of the above errors applied, so the signature is considered to be verified.
{% endif %}
diff --git a/content/v3/issues.md b/content/v3/issues.md
index 63f3f65a22..59e7f99a29 100644
--- a/content/v3/issues.md
+++ b/content/v3/issues.md
@@ -159,9 +159,10 @@ Name | Type | Description
-----|------|--------------
`title`|`string` | **Required**. The title of the issue.
`body`|`string` | The contents of the issue.
-`assignee`|`string` | Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise._
+`assignee`|`string` | Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is [deprecated](https://developer.github.com/v3/versions/#v3-deprecations).**_
`milestone`|`integer` | The `number` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._
`labels`|`array` of `strings` | Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._
+`assignees`|`array` of `strings` | Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._
#### Example
@@ -169,6 +170,7 @@ Name | Type | Description
:title => "Found a bug",
:body => "I'm having a problem with this.",
:assignee => "octocat",
+ :assignees => [get_resource(:user)],
:milestone => 1,
:labels => %w(bug)
%>
@@ -190,11 +192,11 @@ Name | Type | Description
-----|------|--------------
`title`|`string` | The title of the issue.
`body`|`string` | The contents of the issue.
-`assignee`|`string` | Login for the user that this issue should be assigned to.
+`assignee`|`string` | Login for the user that this issue should be assigned to. **This field is [deprecated](https://developer.github.com/v3/versions/#v3-deprecations).**
`state`|`string` | State of the issue. Either `open` or `closed`.
`milestone`|`integer` | The `number` of the milestone to associate this issue with or `null` to remove current. _NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise._
`labels`|`array` of `strings` | Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (`[]`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._
-
+`assignees`|`array` of `strings` | Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. .Send an empty array (`[]`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._
#### Example
@@ -202,6 +204,7 @@ Name | Type | Description
:title => "Found a bug",
:body => "I'm having a problem with this.",
:assignee => "octocat",
+ :assignees => [get_resource(:user)],
:milestone => 1,
:state => "open",
:labels => %w(bug)
@@ -212,10 +215,10 @@ Name | Type | Description
<%= headers 200 %>
<%= json :full_issue %>
-{% if page.version == 'dotcom' %}
-
+{% if page.version == 'dotcom' or page.version >= 2.6 %}
## Lock an issue
+{% if page.version == 2.6 %}
{{#tip}}
@@ -229,6 +232,7 @@ Name | Type | Description
application/vnd.github.the-key-preview+json
{{/tip}}
+{% endif %}
Users with push access can lock an issue's conversation.
@@ -242,6 +246,7 @@ Users with push access can lock an issue's conversation.
## Unlock an issue
+{% if page.version == 2.6 %}
{{#tip}}
@@ -255,6 +260,7 @@ Users with push access can lock an issue's conversation.
application/vnd.github.the-key-preview+json
{{/tip}}
+{% endif %}
Users with push access can unlock an issue's conversation.
diff --git a/content/v3/issues/assignees.md b/content/v3/issues/assignees.md
index 8a48cdb867..4d0c1a59a0 100644
--- a/content/v3/issues/assignees.md
+++ b/content/v3/issues/assignees.md
@@ -35,3 +35,33 @@ Otherwise a `404` status code is returned.
<%= headers 404 %>
[available assignees]: https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/
+
+## Add assignees to an Issue
+
+This call adds the users passed in the `assignees` key (as their logins) to the issue.
+
+ POST /repos/:owner/:repo/issues/:number/assignees
+
+### Input
+
+<%= json({"assignees" => %w(hubot other_assignee)}) %>
+
+### Response
+
+<%= headers 201 %>
+<%= json :issue_with_assignees %>
+
+## Remove assignees from an Issue
+
+This call removes the users passed in the `assignees` key (as their logins) from the issue.
+
+ DELETE /repos/:owner/:repo/issues/:number/assignees
+
+### Input
+
+<%= json({"assignees" => %w(hubot other_assignee)}) %>
+
+### Response
+
+<%= headers 200 %>
+<%= json :issue_with_assignees %>
diff --git a/content/v3/issues/events.md b/content/v3/issues/events.md
index e285264f3a..2b40755155 100644
--- a/content/v3/issues/events.md
+++ b/content/v3/issues/events.md
@@ -6,7 +6,7 @@ title: Issue Events
{:toc}
-Records various events that occur around an Issue or Pull Request. This is
+Records various events that occur around an issue or pull request. This is
useful both for display on issue/pull request information pages and also to
determine who should be notified of comments.
@@ -20,7 +20,7 @@ determine who should be notified of comments.
The API URL for fetching the event.
actor
- Always the User object that generated the event.
+ The User object that generated the event.
commit_id
The String SHA of a commit that referenced this Issue
@@ -35,8 +35,8 @@ determine who should be notified of comments.
The timestamp indicating when the event occurred.
label
- The Label object including 'name' and 'color' attributes. Only provided for 'labeled'
- and 'unlabeled' events.
+ The Label object including `name` and `color` attributes. Only provided for `labeled`
+ and `unlabeled` events.
assignee
The User object which was assigned to (or unassigned from) this Issue. Only provided for 'assigned' and 'unassigned' events.
@@ -47,12 +47,12 @@ determine who should be notified of comments.
{% endif %}
milestone
- The Milestone object including a 'title' attribute. Only provided for 'milestoned' and
- 'demilestoned' events.
+ The Milestone object including a `title` attribute. Only provided for `milestoned` and
+ `demilestoned` events.
rename
- An object containing rename details including 'from' and 'to' attributes. Only
- provided for 'renamed' events.
+ An object containing rename details including `from` and `to` attributes. Only
+ provided for `renamed` events.
### Events
diff --git a/content/v3/issues/labels.md b/content/v3/issues/labels.md
index 5830e0bbf1..718a0c6339 100644
--- a/content/v3/issues/labels.md
+++ b/content/v3/issues/labels.md
@@ -51,8 +51,8 @@ Name | Type | Description
Name | Type | Description
-----|------|--------------
-`name`|`string` | **Required**. The name of the label.
-`color`|`string` |**Required**. A 6 character hex code, without the leading `#`, identifying the color.
+`name`|`string` | The name of the label.
+`color`|`string` | A 6 character hex code, without the leading `#`, identifying the color.
<%= json :name => "bug", :color => "f29513" %>
diff --git a/content/v3/issues/timeline.md b/content/v3/issues/timeline.md
new file mode 100644
index 0000000000..c1ba039e0e
--- /dev/null
+++ b/content/v3/issues/timeline.md
@@ -0,0 +1,149 @@
+---
+title: Issue Timeline
+---
+
+{{#tip}}
+
+
+
+ The API to get issue timeline events is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-23-timeline-preview-api/) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.mockingbird-preview
+
+{{/tip}}
+
+# Timeline
+
+{:toc}
+
+Records various events that occur around an issue or pull request. This is
+useful both for display on issue and pull request information pages, as well as to
+determine who should be notified of comments.
+
+### Attributes
+
+
+ - id
+ - The Integer ID of the event.
+
+ - url
+ - The API URL for fetching the event.
+
+ - actor
+ - The User object that generated the event.
+
+ - commit_id
+ - The String SHA of a commit that referenced this Issue.
+
+ - event
+ - Identifies the actual type of Event that occurred.
+
+ - created_at
+ - The timestamp indicating when the event occurred.
+
+ - label
+ - The Label object including `name` and `color` attributes. Only provided for `labeled`
+ and `unlabeled` events.
+
+ - assignee
+ - The User object which was assigned to (or unassigned from) this Issue. Only provided for `assigned` and `unassigned` events.
+
+ - milestone
+ - The Milestone object including a `title` attribute. Only provided for `milestoned` and
+ `demilestoned` events.
+
+ - source
+ - The `id`, `actor`, and `url` for the source of a reference from
+another issue. Only provided for `cross-referenced` events.
+
+ - rename
+ - An object containing rename details including `from` and `to` attributes. Only
+ provided for `renamed` events.
+
+
+### Events
+
+
+ - assigned
+ - The issue was assigned to the assignee.
+
+ - closed
+ - The issue was closed by the actor. When the commit_id is present, it
+ identifies the commit that closed the issue using "closes / fixes #NN"
+ syntax.
+
+ - commented
+ - A comment was added to the issue.
+
+ - committed
+ - A commit was added to the pull request's `HEAD` branch. Only
+provided for pull requests.
+
+ - cross-referenced
+ - The issue was referenced from another issue. The `source`
+attribute contains the `id`, `actor`, and `url` of the reference's
+source.
+
+ - demilestoned
+ - The issue was removed from a milestone.
+
+ - head_ref_deleted
+ - The pull request's branch was deleted.
+
+ - head_ref_restored
+ - The pull request's branch was restored.
+
+ - labeled
+ - A label was added to the issue.
+
+ - locked
+ - The issue was locked by the actor.
+
+ - mentioned
+ - The actor was @mentioned in an issue body.
+
+ - merged
+ - The issue was merged by the actor. The `commit_id` attribute is the SHA1 of
+ the HEAD commit that was merged.
+
+ - milestoned
+ - The issue was added to a milestone.
+
+ - referenced
+ - The issue was referenced from a commit message. The `commit_id` attribute is
+ the commit SHA1 of where that happened.
+
+ - renamed
+ - The issue title was changed.
+
+ - reopened
+ - The issue was reopened by the actor.
+
+ - subscribed
+ - The actor subscribed to receive notifications for an issue.
+
+ - unassigned
+ - The assignee was unassigned from the issue.
+
+ - unlabeled
+ - A label was removed from the issue.
+
+ - unlocked
+ - The issue was unlocked by the actor.
+
+ - unsubscribed
+ - The actor unsubscribed to stop receiving notifications for an issue.
+
+
+## List events for an issue
+
+ GET /repos/:owner/:repo/issues/:issue_number/timeline
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:issue_event) { |h| [h] } %>
diff --git a/content/v3/migration/source_imports.md b/content/v3/migration/source_imports.md
index 80d1e6acdf..044cc0079e 100644
--- a/content/v3/migration/source_imports.md
+++ b/content/v3/migration/source_imports.md
@@ -24,7 +24,7 @@ This API is not currently available on GitHub Enterprise.
{{/tip}}
-The Source Import API lets you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as [the GitHub Importer](https://import.github.com/).
+The Source Import API lets you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as [the GitHub Importer](https://help.github.com/articles/importing-from-other-version-control-systems-to-github/).
A typical source import would [start the import](#start-an-import) and then (optionally) [update the authors](#map-a-commit-author) and/or [set the preference](#set-git-lfs-preference) for using Git LFS if large files exist in the import. A more detailed example can be seen in this diagram:
@@ -156,11 +156,17 @@ An import that does not have errors will progress through these steps:
If there are problems, you will see one of these in the `status` field:
-* `auth_failed` - the import requires authentication in order to connect to the original repository. Make an "Update Existing Import" request, and include `vcs_username` and `vcs_password`.
+* `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update Existing Import](#update-existing-import) section.
* `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. [Contact support](https://github.com/contact?form%5Bsubject%5D=Source+Import+API+error) for more information.
-* `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. Make an "Update Existing Import" request, and include `vcs_username` and `vcs_password`.
-* `detection_found_nothing` - the importer didn't recognize any source control at the URL.
-* `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. Make an "Update Existing Import" request, and include `vcs` and (if applicable) `tfvc_project`.
+* `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update Existing Import](#update-existing-import) section.
+* `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](#cancel-an-import) and [retry](#start-an-import) with the correct URL.
+* `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update Existing Import](#update-existing-import) section.
+
+### The `project_choices` field
+
+When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type.
+
+<%= json :source_import_project_choices %>
### Git LFS related fields
@@ -169,19 +175,14 @@ This section includes details about Git LFS related fields that may be present i
* `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken.
* `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step.
* `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository.
-* `large_files_count` - the total number of of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request.
+* `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request.
## Update existing import
-An import can be updated with credentials or a `project_choice` by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted.
+An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted.
PATCH /repos/:owner/:repo/import
-### Response
-
-<%= headers 200, :Location => "https://api.github.com/repos/spraints/socm/import" %>
-<%= json :source_import %>
-
### Parameters for updating authentication
Name | Type | Description
@@ -203,16 +204,18 @@ Name | Type | Description
### Parameters for updating project choice
-Name | Type | Description
------|------|--------------
-`vcs`|`string`|The chosen project's VCS type.
-`tfvc_project`|`string`|For a tfvc import, the name of the project that is being imported.
+Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress will have the status `detection_found_multiple` and the Import Progress response will include a `project_choices` array. You can select the project to import by providing one of the objects in the `project_choices` array in the update request.
+
+The following example demonstrates the workflow for updating an import with "project1" as the project choice. Given a `project_choices` array like such:
+
+<%= json :source_import_project_choices %>
### Example
<%= json\
- :vcs => "tfvc",
- :tfvc_project => "project"
+ "vcs": "tfvc",
+ "tfvc_project": "project1",
+ "human_name": "project1 (tfs)"
%>
### Response
@@ -220,6 +223,15 @@ Name | Type | Description
<%= headers 200 %>
<%= json :source_import_update_project_choice %>
+### Parameters for restarting import
+
+To restart an import, no parameters are provided in the update request.
+
+### Response
+
+<%= headers 200, :Location => "https://api.github.com/repos/spraints/socm/import" %>
+<%= json :source_import %>
+
## Get commit authors
Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `.
diff --git a/content/v3/misc.md b/content/v3/misc.md
index 01a57d22a2..7fefcbb369 100644
--- a/content/v3/misc.md
+++ b/content/v3/misc.md
@@ -33,11 +33,15 @@ organization's [GitHub Enterprise](https://enterprise.github.com/) installation.
{% endif %}
+{% if page.version == 'dotcom' %}
+
## [Rate Limit][]
The [Rate Limit API][Rate Limit] lets you check your current rate limit
status at any time.
+{% endif %}
+
## [Licenses][]
The [Licenses API][Licenses] returns information about open source licenses or under what license, if any a given project is distributed.
diff --git a/content/v3/oauth.md b/content/v3/oauth.md
index f1eef51017..1555d954d7 100644
--- a/content/v3/oauth.md
+++ b/content/v3/oauth.md
@@ -6,7 +6,7 @@ title: OAuth
{:toc}
-OAuth2 is a protocol that lets external apps request authorization to
+OAuth2 is a protocol that lets external applications request authorization to
private details in a user's {{ site.data.variables.product.product_name }} account without getting their
password. This is preferred over [Basic Authentication](/v3/auth#basic-authentication) because tokens can
be limited to specific types of data, and can be revoked by users at any
@@ -34,10 +34,10 @@ This is a description of the OAuth2 flow from 3rd party web sites.
Name | Type | Description
-----|------|--------------
`client_id`|`string` | **Required**. The client ID you received from GitHub when you [registered](https://github.com/settings/applications/new).
-`redirect_uri`|`string` | The URL in your app where users will be sent after authorization. See details below about [redirect urls](#redirect-urls).
-`scope`|`string` | A space delimited list of [scopes](#scopes). If not provided, `scope` defaults to an empty list of scopes for users that don't have a valid token for the app. For users who do already have a valid token for the app, the user won't be shown the OAuth authorization page with the list of scopes. Instead, this step of the flow will automatically complete with the same scopes that were used last time the user completed the flow.
+`redirect_uri`|`string` | The URL in your application where users will be sent after authorization. See details below about [redirect urls](#redirect-urls).
+`scope`|`string` | A space delimited list of [scopes](#scopes). If not provided, `scope` defaults to an empty list for users that have not authorized any scopes for the application. For users who have authorized scopes for the application, the user won't be shown the OAuth authorization page with the list of scopes. Instead, this step of the flow will automatically complete with the set of scopes the user has authorized for the application. For example, if a user has already performed the web flow twice and has authorized one token with `user` scope and another token with `repo` scope, a third web flow that does not provide a `scope` will receive a token with `user` and `repo` scope.
`state`|`string` | An unguessable random string. It is used to protect against cross-site request forgery attacks.
-`allow_signup`|`string` | Whether or not unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. The default is `true`. Use `false` in the case that a policy prohibits signups.
+`allow_signup`|`boolean` | Whether or not unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. The default is `true`. Use `false` in the case that a policy prohibits signups.
### 2. GitHub redirects back to your site
@@ -57,7 +57,7 @@ Name | Type | Description
`client_id`|`string` | **Required**. The client ID you received from GitHub when you [registered](https://github.com/settings/applications/new).
`client_secret`|`string` | **Required**. The client secret you received from GitHub when you [registered](https://github.com/settings/applications/new).
`code`|`string` | **Required**. The code you received as a response to [Step 1](#1-redirect-users-to-request-github-access).
-`redirect_uri`|`string` | The URL in your app where users will be sent after authorization. See details below about [redirect urls](#redirect-urls).
+`redirect_uri`|`string` | The URL in your application where users will be sent after authorization. See details below about [redirect urls](#redirect-urls).
`state`|`string` | The unguessable random string you optionally provided in [Step 1](#1-redirect-users-to-request-github-access).
### Response
@@ -79,6 +79,19 @@ header:
e72e16c7e42f292c6912e7710c838347ae178b4a
+#### Multiple tokens
+
+GitHub allows multiple tokens to exist for a user/application/scope combination.
+This can be used to create tokens for specific use cases. For example, your
+application might support one workflow that uses GitHub for sign in, and only
+requires basic user information. And, your application might support a different
+workflow that requires access to a user's private repositories. Using multiple
+tokens, your application can perform the web flow for each use case, requesting
+only the scopes needed. If a user only uses your application to sign in, they
+are never required to grant your application access to their private
+repositories. Note, there is a limit to the number of tokens that are issued per
+user/application/scope combination. If your application requests enough tokens
+to go over one of the limits, older tokens will stop working.
#### Requested scopes vs. granted scopes
@@ -183,7 +196,7 @@ Name | Description
`user:email`| Grants read access to a user's email addresses.
`user:follow`| Grants access to follow or unfollow other users.
`public_repo`| Grants read/write access to code, commit statuses, collaborators, and deployment statuses for public repositories and organizations. Also required for starring public repositories.
-`repo`| Grants read/write access to code, commit statuses, collaborators, and deployment statuses for public and private repositories and organizations.
+`repo`| Grants read/write access to code, commit statuses, repository invitations, collaborators, and deployment statuses for public and private repositories and organizations.
`repo_deployment`| Grants access to [deployment statuses][deployments] for public and private repositories. This scope is only necessary to grant other users or services access to deployment statuses, *without* granting access to the code.
`repo:status`| Grants read/write access to public and private repository commit statuses. This scope is only necessary to grant other users or services access to private repository commit statuses *without* granting access to the code.
`delete_repo`| Grants access to delete adminable repositories.
@@ -319,7 +332,7 @@ and get a new code.
Users can review and revoke their application authorizations from the [settings
screen within GitHub][authorized-apps]. A user's organizations [control whether
an application can access organization data][org-app-policies]. Integrators can
-deep link to the authorization information for their particular app to let their
+deep link to the authorization information for their particular application to let their
end users review these details.
To build this link, you'll need your OAuth application's `client_id` you
diff --git a/content/v3/orgs.md b/content/v3/orgs.md
index 2a44ac3291..aa7419a031 100644
--- a/content/v3/orgs.md
+++ b/content/v3/orgs.md
@@ -21,6 +21,8 @@ This only lists organizations that your authorization allows you to operate on i
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:org) { |h| [h] } %>
+{% if page.version == 'dotcom' or page.version >= 2.3 %}
+
## List all organizations
Lists all organizations, in the order that they were created on {{ site.data.variables.product.product_name }}.
@@ -42,6 +44,8 @@ Name | Type | Description
<%= headers 200, :pagination => { :next => 'https://api.github.com/organizations?since=135' } %>
<%= json(:org) {|h| [h] } %>
+{% endif %}
+
## List user organizations
List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.
@@ -57,6 +61,12 @@ This method only lists *public* memberships, regardless of authentication. If yo
## Get an organization
+{% if page.version == 'dotcom' or page.version >= 2.8 %}
+Note: To receive values for `private_gists`, `disk_usage`, `collaborators`, and
+`billing_email` in the Organization response, the authenticated user must be an
+organization owner and have authorized the `admin:org` scope.
+{% endif %}
+
GET /orgs/:org
### Response
diff --git a/content/v3/orgs/hooks.md b/content/v3/orgs/hooks.md
index 4600626ac1..a00c5c4836 100644
--- a/content/v3/orgs/hooks.md
+++ b/content/v3/orgs/hooks.md
@@ -161,7 +161,6 @@ Name | Description
[guid]: http://en.wikipedia.org/wiki/Globally_unique_identifier
-[hub-signature]: https://github.com/github/github-services/blob/f3bb3dd780feb6318c42b2db064ed6d481b70a1f/lib/service/http_helper.rb#L77
[ping-event-url]: /webhooks/#ping-event
[webhook-events]: /webhooks/#events
[event-types]: /v3/activity/events/types/
diff --git a/content/v3/orgs/members.md b/content/v3/orgs/members.md
index e3f8175fd4..6f1b79abe4 100644
--- a/content/v3/orgs/members.md
+++ b/content/v3/orgs/members.md
@@ -25,7 +25,7 @@ Name | Type | Description
[2fa-blog]: https://github.com/blog/1614-two-factor-authentication
-{% if page.version != 'dotcom' and (page.version == 2.4 or page.version == 2.5) %}
+{% if page.version != 'dotcom' and page.version > 2.3 and page.version < 2.6 %}
{{#tip}}
@@ -144,7 +144,11 @@ The user can publicize their own membership.
## Get organization membership
-{% if page.version == 'dotcom' or page.version >= 2.4 %}
+{% if page.version == 'dotcom' or page.version >= 2.6 %}
+
+In order to get a user's membership with an organization, the authenticated user must be an organization member.
+
+{% elsif page.version >= 2.4 %}
In order to get a user's membership with an organization, the authenticated user must be an organization owner.
diff --git a/content/v3/orgs/pre_receive_hooks.md b/content/v3/orgs/pre_receive_hooks.md
new file mode 100644
index 0000000000..7d3afc0bd4
--- /dev/null
+++ b/content/v3/orgs/pre_receive_hooks.md
@@ -0,0 +1,83 @@
+---
+title: Organization Pre-receive Hooks
+---
+
+# Organization Pre-receive Hooks (Enterprise)
+
+{{#tip}}
+
+
+
+ APIs for managing pre-receive hooks are currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.eye-scream-preview
+
+{{/tip}}
+
+{:toc}
+
+The Organization Pre-receive Hooks API allows you to view and modify
+enforcement of the pre-receive hooks that are available to an organization.
+
+Prefix all the endpoints for this API with the following URL:
+
+``` command-line
+http(s)://hostname/api/v3
+```
+
+## Object attributes
+
+| Name | Type | Description |
+|----------------------------------|-----------|-----------------------------------------------------------|
+| `name` | `string` | The name of the hook. |
+| `enforcement` | `string` | The state of enforcement for the hook on this repository. |
+| `allow_downstream_configuration` | `boolean` | Whether repositories can override enforcement. |
+| `configuration_url` | `string` | URL for the endpoint where enforcement is set. |
+
+Possible values for *enforcement* are `enabled`, `disabled` and`testing`. `disabled` indicates the pre-receive hook will not run. `enabled` indicates it will run and reject
+any pushes that result in a non-zero status. `testing` means the script will run but will not cause any pushes to be rejected.
+
+`configuration_url` may be a link to this endpoint or this hook's global
+configuration. Only site admins are able to access the global configuration.
+
+## List pre-receive hooks
+
+List all pre-receive hooks that are enabled or testing for this
+organization as well as any disabled hooks that can be configured at the
+organization level. Globally disabled pre-receive hooks that do not allow
+downstream configuration are not listed.
+
+ GET /orgs/:org/pre-receive-hooks
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json :pre_receive_hooks_org %>
+
+## Get a single pre-receive hook
+
+ GET /orgs/:org:pre-receive-hooks/:id
+
+<%= headers 200 %> <%= json :pre_receive_hook_org %>
+
+## Update pre-receive hook enforcement
+
+For pre-receive hooks which are allowed to be configured at the org level, you can set
+`enforcement` and `allow_downstream_configuration`
+
+ PATCH /orgs/:org/pre-receive-hooks/:id
+
+<%= json :enforcement => "enabled", :allow_downstream_configuration => false %>
+
+### Response
+
+<%= headers 200 %><%= json :pre_receive_hook_org_update %>
+
+## Remove enforcment overrides for a pre-receive hook
+
+Removes any overrides for this hook at the org level for this org.
+
+ DELETE /orgs/:org/pre-receive-hooks/:id
+
+<%= headers 200 %> <%= json :pre_receive_hook_org %>
diff --git a/content/v3/orgs/teams.md b/content/v3/orgs/teams.md
index 1aa57d3d87..07a233bea9 100644
--- a/content/v3/orgs/teams.md
+++ b/content/v3/orgs/teams.md
@@ -54,7 +54,7 @@ Name | Type | Description
`privacy`|`string`| The level of privacy this team should have. Can be one of:
* `secret` - only visible to organization owners and members of this team.
* `closed` - visible to all members of this organization.
Default: `secret`
{% if page.version != 'dotcom' and page.version == 2.4 %}**This parameter requires a custom media type to be specified. Please see more in the alert below.**{% endif %}
`permission`|`string` | **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of:
* `pull` - team members can pull, but not push to or administer newly-added repositories.
* `push` - team members can pull and push, but not administer newly-added repositories.
* `admin` - team members can pull, push and administer newly-added repositories.
Default: `pull`
-{% if page.version != 'dotcom' and (page.version == 2.4 or page.version == 2.5) %}
+{% if page.version != 'dotcom' and page.version > 2.3 and page.version < 2.6 %}
{{#tip}}
@@ -129,7 +129,7 @@ Name | Type | Description
`privacy`|`string`| The level of privacy this team should have. Can be one of:
* `secret` - only visible to organization owners and members of this team.
* `closed` - visible to all members of this organization.
Default: `secret`
{% if page.version != 'dotcom' and page.version == 2.4 %}**This parameter requires a custom media type to be specified. Please see more in the alert below.**{% endif %}
`permission`|`string` | **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of:
* `pull` - team members can pull, but not push to or administer newly-added repositories.
* `push` - team members can pull and push, but not administer newly-added repositories.
* `admin` - team members can pull, push and administer newly-added repositories.
Default: `pull`
-{% if page.version != 'dotcom' and (page.version == 2.4 or page.version == 2.5) %}
+{% if page.version != 'dotcom' and page.version > 2.3 and page.version < 2.6 %}
{{#tip}}
@@ -522,7 +522,7 @@ Name | Type | Description
{% endif %}
-{% if page.version != 'dotcom' and (page.version == 2.4 or page.version == 2.5) %}
+{% if page.version != 'dotcom' and page.version > 2.3 and page.version < 2.6 %}
{{#tip}}
diff --git a/content/v3/pulls.md b/content/v3/pulls.md
index 7d73679708..332c98ff3d 100644
--- a/content/v3/pulls.md
+++ b/content/v3/pulls.md
@@ -87,7 +87,7 @@ Name | Type | Description
-----|------|-------------
`title`|`string` | **Required**. The title of the pull request.
`head`|`string` | **Required**. The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`.
-`base`|`string` | **Required**. The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.
+`base`|`string` | **Required**. The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.
`body`|`string` | The contents of the pull request.
@@ -132,14 +132,18 @@ Name | Type | Description
-----|------|--------------
`title`|`string` | The title of the pull request.
`body`|`string` | The contents of the pull request.
-`state`|`string` | State of this Pull Request. Either `open` or `closed`.
+`state`|`string` | State of this Pull Request. Either `open` or `closed`.{% if page.version == 'dotcom' or page.version >= 2.8 %}
+`base`|`string` | The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository.
+{% endif %}
#### Example
<%= json \
:title => "new title",
:body => "updated body",
- :state => "open"
+ :state => "open"{% if page.version == 'dotcom' or page.version >= 2.8 %},
+ :base => "master"
+{% endif %}
%>
### Response
diff --git a/content/v3/rate_limit.md b/content/v3/rate_limit.md
index b19c878ecb..cb27f21b3b 100644
--- a/content/v3/rate_limit.md
+++ b/content/v3/rate_limit.md
@@ -2,6 +2,8 @@
title: Rate Limit
---
+{% if page.version == 'dotcom' %}
+
# Rate Limit
The overview documentation describes the [rate limit rules](/v3/#rate-limiting).
@@ -49,3 +51,5 @@ version of the API.
If you're writing new API client code (or updating your existing code), you
should use the `"core"` object instead of the `"rate"` object. The `"core"` object
contains the same information that is present in the `"rate"` object.
+
+{% endif %}
diff --git a/content/v3/reactions.md b/content/v3/reactions.md
index a492093f4c..d8effc8a38 100644
--- a/content/v3/reactions.md
+++ b/content/v3/reactions.md
@@ -2,7 +2,7 @@
title: Reactions
---
-{% if page.version == 'dotcom' %}
+{% if page.version == 'dotcom' or page.version >= 2.7 %}
# Reactions
@@ -24,7 +24,7 @@ title: Reactions
## Reaction types
-
+
When creating a reaction, the allowed values for the `content` parameter are as follows (with the corresponding emoji for reference):
content | emoji
diff --git a/content/v3/repos.md b/content/v3/repos.md
index e4f1240ddf..2e8b726228 100644
--- a/content/v3/repos.md
+++ b/content/v3/repos.md
@@ -250,122 +250,6 @@ List languages for the specified repository. The value on the right of a languag
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:tag) { |h| [h] } %>
-## List Branches
-
- GET /repos/:owner/:repo/branches
-
-### Parameters
-
-Name | Type | Description
------|------|-------------
-`protected`|`string` | Set to `1` or `true` to only return protected branches.
-
-{{#tip}}
-
-
-
- The `protected` parameter is currently available for developers to preview.
- During the preview period, the API may change without advance notice.
- Please see the [blog post](/changes/2015-11-11-protected-branches-api) for full details.
-
- To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
-
- application/vnd.github.loki-preview+json
-
- The `protection` key will only be present in branch payloads if this header is passed.
-
-{{/tip}}
-
-### Response
-
-<%= headers 200, :pagination => default_pagination_rels %>
-<%= json(:branches) %>
-
-## Get Branch
-
- GET /repos/:owner/:repo/branches/:branch
-
-### Response
-
-{{#tip}}
-
-
-
- The Protected Branch API is currently available for developers to preview.
- During the preview period, the API may change without advance notice.
- Please see the [blog post](/changes/2015-11-11-protected-branches-api) for full details.
-
- To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
-
- application/vnd.github.loki-preview+json
-
- The `protection` key will only be present in branch payloads if this header is passed.
-
-{{/tip}}
-
-<%= headers 200 %>
-<%= json(:branch) %>
-
-{% if page.version == 'dotcom' or page.version >= 2.5 %}
-
-## Enabling and disabling branch protection
-
-{{#tip}}
-
-
-
- The Protected Branch API is currently available for developers to preview.
- During the preview period, the API may change without advance notice.
- Please see the [blog post](/changes/2015-11-11-protected-branches-api) for full details.
-
- To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
-
- application/vnd.github.loki-preview+json
-
-{{/tip}}
-
-Protecting a branch requires admin access.
-
- PATCH /repos/:owner/:repo/branches/:branch
-
-### Input
-
-You need to pass a `protection` object.
-
-Name | Type | Description
------|------|-------------
-`enabled`|`boolean` | **Required**. Should this branch be protected or not
-`required_status_checks`|`object`| Configure required status checks here
-
-The `required_status_checks` object must have the following keys:
-
-Name | Type | Description
------|------|-------------
-`enforcement_level`|`string` | **Required**. Who required status checks apply to. Options are `off`, `non_admins` or `everyone`.
-`contexts`|`array` | **Required**. The list of status checks to require in order to merge into this branch
-
-The `enforcement_level` key can have the following values:
-
-Name | Description
-------|------------
-`off` | Turn off required status checks for this branch.
-`non_admins` | Required status checks will be enforced for non-admins.
-`everyone` | Required status checks will be enforced for everyone (including admins).
-
-#### Example
-
-<%= json \
- "protection" => {
- "enabled" => true,
- "required_status_checks" => {
- "enforcement_level" => "everyone",
- "contexts" => ["continuous-integration/travis-ci"]
- }
- }
-%>
-
-{% endif %}
-
## Delete a Repository
Deleting a repository requires admin access. If OAuth is used, the
diff --git a/content/v3/repos/branches.md b/content/v3/repos/branches.md
new file mode 100644
index 0000000000..e620efd95c
--- /dev/null
+++ b/content/v3/repos/branches.md
@@ -0,0 +1,522 @@
+---
+title: Branches
+---
+
+# Branches
+
+{:toc}
+
+{% if page.version != 'dotcom' and page.version >= 2.5 and page.version < 2.7 %}
+
+## List Branches
+
+ GET /repos/:owner/:repo/branches
+
+### Parameters
+
+Name | Type | Description
+-----|------|-------------
+`protected`| `boolean` | Set to `true` to only return protected branches
+
+{{#tip}}
+
+
+
+ The Protected Branch API is currently available for developers to preview.
+ During the preview period, the API may change without advance notice.
+ Please see the [blog post](/changes/2015-11-11-protected-branches-api) for full details.
+
+ To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.loki-preview+json
+
+ The `protection` key will only be present in branch payloads if this header is passed.
+
+{{/tip}}
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:branches) { |a| a.each { |b| b.merge!("protection" => {
+ "enabled" => false,
+ "required_status_checks" => {
+ "enforcement_level" => "off",
+ "contexts" => []
+ }
+}) } } %>
+
+## Get Branch
+
+ GET /repos/:owner/:repo/branches/:branch
+
+### Response
+
+{{#tip}}
+
+
+
+ The Protected Branch API is currently available for developers to preview.
+ During the preview period, the API may change without advance notice.
+ Please see the [blog post](/changes/2015-11-11-protected-branches-api) for full details.
+
+ To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.loki-preview+json
+
+ The `protection` key will only be present in branch payloads if this header is passed.
+
+{{/tip}}
+
+<%= headers 200 %>
+<%= json(:branch) { |h| h.merge!("protection" => {
+ "enabled" => false,
+ "required_status_checks" => {
+ "enforcement_level" => "off",
+ "contexts" => []
+ }
+}) } %>
+
+## Enabling and disabling branch protection
+
+{{#tip}}
+
+
+
+ The Protected Branch API is currently available for developers to preview.
+ During the preview period, the API may change without advance notice.
+ Please see the [blog post](/changes/2015-11-11-protected-branches-api) for full details.
+
+ To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.loki-preview+json
+
+{{/tip}}
+
+Protecting a branch requires admin access.
+
+ PATCH /repos/:owner/:repo/branches/:branch
+
+### Parameters
+
+You need to pass a `protection` object.
+
+Name | Type | Description
+-----|------|-------------
+`enabled`|`boolean` | **Required**. Should this branch be protected or not
+`required_status_checks`|`object`| Configure required status checks here
+
+The `required_status_checks` object must have the following keys:
+
+Name | Type | Description
+-----|------|-------------
+`enforcement_level`|`string` | **Required**. Who required status checks apply to. Options are `off`, `non_admins` or `everyone`.
+`contexts`|`array` | **Required**. The list of status checks to require in order to merge into this branch
+
+The `enforcement_level` key can have the following values:
+
+Name | Description
+------|------------
+`off` | Turn off required status checks for this branch.
+`non_admins` | Required status checks will be enforced for non-admins.
+`everyone` | Required status checks will be enforced for everyone (including admins).
+
+#### Example
+
+<%= json \
+ "protection" => {
+ "enabled" => true,
+ "required_status_checks" => {
+ "enforcement_level" => "everyone",
+ "contexts" => ["continuous-integration/travis-ci"]
+ }
+ }
+%>
+
+{% endif %}
+
+{% if page.version == 'dotcom' or page.version >= 2.7 %}
+
+{{#tip}}
+
+
+
+ The Protected Branch API is currently available for developers to preview.
+ During the preview period, the API may change without advance notice.
+ Please see the [blog post](/changes/2016-06-27-protected-branches-api-update) for full details.
+
+ To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.loki-preview+json
+
+{{/tip}}
+
+## List Branches
+
+ GET /repos/:owner/:repo/branches
+
+### Parameters
+
+Name | Type | Description
+-----|------|-------------
+`protected` | `boolean` | Set to `true` to only return protected branches
+
+{{#tip}}
+
+
+
+ The Protected Branch API is currently available for developers to preview.
+ During the preview period, the API may change without advance notice.
+ Please see the [blog post](/changes/2016-06-27-protected-branches-api-update) for full details.
+
+ To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.loki-preview+json
+
+ The `protected` key will only be present in branch payloads if this header is passed.
+
+{{/tip}}
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:branches) { |a| a.each { |b| b.merge!(
+ "protected": true,
+ "protection_url": "https://api.github.com/repos/octocat/Hello-World/branches/#{b["name"]}/protection",
+) } } %>
+
+## Get Branch
+
+ GET /repos/:owner/:repo/branches/:branch
+
+### Response
+
+{{#tip}}
+
+
+
+ The Protected Branch API is currently available for developers to preview.
+ During the preview period, the API may change without advance notice.
+ Please see the [blog post](/changes/2016-06-27-protected-branches-api-update) for full details.
+
+ To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.loki-preview+json
+
+ The `protected` key will only be present in branch payloads if this header is passed.
+
+{{/tip}}
+
+<%= headers 200 %>
+<%= json(:branch) { |h| h.merge!(
+ "protected": true,
+ "protection_url": "https://api.github.com/repos/octocat/Hello-World/branches/#{h["name"]}/protection",
+) } %>
+
+
+## Get branch protection
+
+ GET /repos/:owner/:repo/branches/:branch/protection
+
+<%= headers 200 %>
+<%= json(:repo_branch_protection) %>
+
+## Update branch protection
+
+Protecting a branch requires admin access.
+
+ PUT /repos/:owner/:repo/branches/:branch/protection
+
+### Parameters
+
+You must pass two objects: `required_status_checks` and `restrictions`. Both can have the value `null` for disabled.
+
+The `required_status_checks` object must have the following keys:
+
+Name | Type | Description
+-----|------|-------------
+`include_admins` | `boolean` | **Required**. Enforce required status checks for repository administrators.
+`strict` | `boolean` | **Required**. Require branches to be up to date before merging.
+`contexts` | `array` | **Required**. The list of status checks to require in order to merge into this branch
+
+The `restrictions` object must have the following keys:
+
+Name | Type | Description
+-----|------|-------------
+`users` | `array` | The list of user `login`s with push access
+`teams` | `array` | The list of team `slug`s with push access
+
+{{#tip}}
+
+* Teams and users `restrictions` are only available for organization-owned repositories.
+* The list of users and teams in total is limited to 100 items.
+
+{{/tip}}
+
+### Example
+
+<%= json \
+ "required_status_checks" => {
+ "include_admins" => true,
+ "strict" => true,
+ "contexts" => ["continuous-integration/travis-ci"]
+ },
+ "restrictions" => {
+ "users" => ["octocat"],
+ "teams" => ["justice-league"]
+ }
+%>
+
+### Response
+
+<%= headers 200 %>
+<%= json(:repo_branch_protection) %>
+
+## Remove branch protection
+
+ DELETE /repos/:owner/:repo/branches/:branch/protection
+
+<%= headers 204 %>
+
+## Get required status checks of protected branch
+
+ GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks
+
+<%= headers 200 %>
+<%= json(:repo_branch_protection_required_status_checks) %>
+
+## Update required status checks of protected branch
+
+Updating required status checks requires admin access and branch protection to be enabled.
+
+ PATCH /repos/:owner/:repo/branches/:branch/protection/required_status_checks
+
+### Parameters
+
+The object passed can have the following keys:
+
+Name | Type | Description
+-----|------|-------------
+`include_admins`|`boolean` | Enforce required status checks for repository administrators.
+`strict`|`boolean` | Require branches to be up to date before merging.
+`contexts`|`array` | The list of status checks to require in order to merge into this branch
+
+### Example
+
+<%= json \
+ "include_admins" => true,
+ "strict" => true,
+ "contexts" => ["continuous-integration/travis-ci"]
+%>
+
+### Response
+
+<%= headers 200 %>
+<%= json(:repo_branch_protection_required_status_checks) %>
+
+## Remove required status checks of protected branch
+
+ DELETE /repos/:owner/:repo/branches/:branch/protection/required_status_checks
+
+<%= headers 204 %>
+
+## List required status checks contexts of protected branch
+
+ GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts
+
+<%= headers 200 %>
+<%= json ["continuous-integration/travis-ci"] %>
+
+## Replace required status checks contexts of protected branch
+
+ PUT /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts
+
+### Example
+
+<%= json ["continuous-integration/travis-ci"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json ["continuous-integration/travis-ci"] %>
+
+## Add required status checks contexts of protected branch
+
+ POST /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts
+
+### Example
+
+<%= json ["continuous-integration/jenkins"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json ["continuous-integration/travis-ci", "continuous-integration/jenkins"] %>
+
+## Remove required status checks contexts of protected branch
+
+ DELETE /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts
+
+### Example
+
+<%= json ["continuous-integration/jenkins"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json ["continuous-integration/travis-ci"] %>
+
+
+## Get restrictions of protected branch
+
+{{#tip}}
+
+Teams and users `restrictions` are only available for organization-owned repositories.
+
+{{/tip}}
+
+ GET /repos/:owner/:repo/branches/:branch/protection/restrictions
+
+<%= headers 200 %>
+<%= json(:repo_branch_protection_restrictions) %>
+
+## Remove restrictions of protected branch
+
+ DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions
+
+<%= headers 204 %>
+
+## List team restrictions of protected branch
+
+ GET /repos/:owner/:repo/branches/:branch/protection/restrictions/teams
+
+<%= headers 200 %>
+<%= json(:team) { |h| [h] } %>
+
+## Replace team restrictions of protected branch
+
+ PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/teams
+
+### Body parameters
+
+Pass the list of team `slug`s with push access.
+
+{{#tip}}
+
+ The list of users and teams in total is limited to 100 items.
+
+{{/tip}}
+
+### Example
+
+<%= json ["justice-league"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json(:team) { |h| [h] } %>
+
+## Add team restrictions of protected branch
+
+ POST /repos/:owner/:repo/branches/:branch/protection/restrictions/teams
+
+### Body parameters
+
+Pass the list of team `slug`s with push access.
+
+{{#tip}}
+
+The list of users and teams in total is limited to 100 items.
+
+{{/tip}}
+
+### Example
+
+<%= json ["justice-league"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json(:team) { |h| [h] } %>
+
+## Remove team restrictions of protected branch
+
+ DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/teams
+
+### Example
+
+<%= json ["octocats"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json(:team) { |h| [h] } %>
+
+
+## List user restrictions of protected branch
+
+ GET /repos/:owner/:repo/branches/:branch/protection/restrictions/users
+
+<%= headers 200 %>
+<%= json(:user) { |h| [h] } %>
+
+## Replace user restrictions of protected branch
+
+ PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/users
+
+### Body parameters
+
+Pass the list of user `login`s with push access.
+
+{{#tip}}
+
+The list of users and teams in total is limited to 100 items.
+
+{{/tip}}
+
+### Example
+
+<%= json ["octocat"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json(:user) { |h| [h] } %>
+
+## Add user restrictions of protected branch
+
+ POST /repos/:owner/:repo/branches/:branch/protection/restrictions/users
+
+### Body parameters
+
+Pass the list of user `login`s with push access.
+
+{{#tip}}
+
+The list of users and teams in total is limited to 100 items.
+
+{{/tip}}
+
+### Example
+
+<%= json ["octocat"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json(:user) { |h| [h] } %>
+
+## Remove user restrictions of protected branch
+
+ DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/users
+
+### Example
+
+<%= json ["defunkt"] %>
+
+### Response
+
+<%= headers 200 %>
+<%= json(:user) { |h| [h] } %>
+
+
+{% endif %}
diff --git a/content/v3/repos/collaborators.md b/content/v3/repos/collaborators.md
index b3ddcf3de7..5e22e210d7 100644
--- a/content/v3/repos/collaborators.md
+++ b/content/v3/repos/collaborators.md
@@ -19,11 +19,11 @@ collaborators list.
### Response
+{% if page.version != 'dotcom' and page.version > 2.3 and page.version < 2.6 %}
+
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:user) { |h| [h] } %>
-{% if page.version != 'dotcom' and (page.version == 2.4 or page.version == 2.5) %}
-
### Alternative response with extra repository information
{{#tip}}
@@ -69,8 +69,19 @@ Name | Type | Description
<%= fetch_content(:optional_put_content_length) %>
+{{#tip}}
+
+We're currently offering a preview period allowing applications to opt in to the Repository Invitations API.
+
+To send an invitation to a collaborator rather than directly adding them, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+```
+application/vnd.github.swamp-thing-preview+json
+```
+
+{{/tip}}
-{% if page.version != 'dotcom' and (page.version == 2.4 or page.version == 2.5) %}
+{% if page.version != 'dotcom' and page.version > 2.3 and page.version < 2.6 %}
{{#tip}}
@@ -98,6 +109,11 @@ application/vnd.github.ironman-preview+json
<%= headers 204 %>
+### Response with preview media type
+
+<%= headers 201 %>
+<%= json(:repository_invitation) %>
+
## Remove user as a collaborator
DELETE /repos/:owner/:repo/collaborators/:username
diff --git a/content/v3/repos/commits.md b/content/v3/repos/commits.md
index 80368b7deb..20c2ee69c3 100644
--- a/content/v3/repos/commits.md
+++ b/content/v3/repos/commits.md
@@ -25,9 +25,7 @@ Name | Type | Description
### Response
-<%=
- headers 200, :pagination => { :next => 'https://api.github.com/resource?page=2' }
-%>
+<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:commit) { |h| [h] } %>
## Get a single commit
@@ -98,7 +96,7 @@ Please see the [blog post](/changes/2016-04-04-git-signing-api-preview) for full
To receive signature verification data in commit objects you must provide a custom [media type](/v3/media) in the `Accept` header:
- application/vnd.github.cryptographer-preview+sha
+ application/vnd.github.cryptographer-preview
{{/tip}}
@@ -109,4 +107,35 @@ To receive signature verification data in commit objects you must provide a cust
<%= headers 200 %>
<%= json(:signed_commit) %>
+### The `verification` object
+
+The response will include a `verification` field whose value is an object describing the result of verifying the commit's signature. The following fields are included in the `verification` object:
+
+Name | Type | Description
+-----|------|--------------
+`verified`|`boolean` | Does GitHub consider the signature in this commit to be verified?
+`reason`|`string` | The reason for `verified` value. Possible values and their meanings are enumerated in the table below.
+`signature`|`string` | The signature that was extracted from the commit.
+`payload`|`string` | The value that was signed.
+
+#### The `reason` field
+
+The following are possible `reason`s that may be included in the `verification` object:
+
+Value | Description
+------|------------
+`expired_key` | The key that made the signature is expired.
+`not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature.
+`gpgverify_error` | There was an error communicating with the signature-verification service.
+`gpgverify_unavailable` | The signature-verification service is currently unavailable.
+`unsigned` | The object does not include a signature.
+`unkown_signature_type` | A non-PGP signature was found in the commit.
+`no_user` | No user was associated with the `committer` email address in the commit.
+`unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account.
+`bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature.
+`unknown_key` | The key that made the signature has not been registered with any user's account.
+`malformed_signature` | There was an error parsing the signature.
+`invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature.
+`valid` | None of the above errors applied, so the signature is considered to be verified.
+
{% endif %}
diff --git a/content/v3/repos/deployments.md b/content/v3/repos/deployments.md
index 0dfbfff431..34e2574621 100644
--- a/content/v3/repos/deployments.md
+++ b/content/v3/repos/deployments.md
@@ -59,7 +59,7 @@ Below is a simple sequence diagram for how these interactions would work.
Keep in mind that GitHub is never actually accessing your servers. It's up to
your 3rd party integration to interact with deployment events. This allows for
-[github-services](https://github.com/github/github-services) integrations as
+[GitHub integrations](https://github.com/integrations) as
well as running your own systems depending on your use case. Multiple systems
can listen for deployment events, and it's up to each of those systems to
decide whether or not they're responsible for pushing the code out to your
diff --git a/content/v3/repos/hooks.md b/content/v3/repos/hooks.md
index d82fa9d90c..2208924598 100644
--- a/content/v3/repos/hooks.md
+++ b/content/v3/repos/hooks.md
@@ -10,7 +10,7 @@ The Repository Webhooks API allows repository admins to manage the post-receive
hooks for a repository. Webhooks can be managed using the JSON HTTP API,
or the [PubSubHubbub API](#pubsubhubbub).
-If you would like to set up a single webhook to receive events from all of your organization's respositories, check out our [API documentation for Organization Webhooks][org-hooks].
+If you would like to set up a single webhook to receive events from all of your organization's repositories, check out our [API documentation for Organization Webhooks][org-hooks].
## List hooks
@@ -43,17 +43,17 @@ Repositories can have multiple webhooks installed. Each webhook should have a un
Name | Type | Description
-----|------|--------------
`name`|`string` | **Required**. Use `web` for a webhook or use the name of a valid service. (See /hooks for the list of valid service names.)
-`config`|`object` | **Required**. Key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the [github-services](https://github.com/github/github-services) repository. Booleans are stored internally as "1" for true, and "0" for false. Any JSON `true`/`false` values will be converted automatically.
+`config`|`object` | **Required**. Key/value pairs to provide settings for this hook. These settings vary between hooks and some are defined in the [github-services](https://github.com/github/github-services) repository. Booleans are stored internally as "1" for true, and "0" for false. Any JSON `true`/`false` values will be converted automatically.
`events`|`array` | Determines what events the hook is triggered for. Default: `["push"]`
`active`|`boolean` | Determines whether the hook is actually triggered on pushes.
#### Example
-To create [a webhook](/webhooks), [the following fields are required](https://github.com/github/github-services/blob/master/lib/services/web.rb#L4-11) by the `config`:
+To create [a webhook](/webhooks), the following fields are required by the `config`:
* `url`: A required string defining the URL to which the payloads will be delivered.
* `content_type`: An optional string defining the media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.
-* `secret`: An optional string that's passed with the HTTP requests as an `X-Hub-Signature` header. The value of this header is computed as the [HMAC hex digest of the body, using the `secret` as the key][hub-signature].
+* `secret`: An optional string that's passed with the HTTP requests as an `X-Hub-Signature` header. The value of this header is computed as the HMAC hex digest of the body, using the `secret` as the key.
* `insecure_ssl`: An optional string that determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `"0"` (verification is performed) and `"1"` (verification is not performed). The default is `"0"`.
Here's how you can create a hook that posts payloads in JSON format:
@@ -80,7 +80,7 @@ Here's how you can create a hook that posts payloads in JSON format:
Name | Type | Description
-----|------|--------------
-`config`|`object` | Key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the [github-services](https://github.com/github/github-services) repository. Booleans are stored internally as "1" for true, and "0" for false. Any JSON `true`/`false` values will be converted automatically.
+`config`|`object` | Key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between hooks and some are defined in the [github-services](https://github.com/github/github-services) repository. Booleans are stored internally as "1" for true, and "0" for false. Any JSON `true`/`false` values will be converted automatically.
`events`|`array` | Determines what events the hook is triggered for. This replaces the entire array of events. Default: `["push"]`
`add_events`|`array` | Determines a list of events to be added to the list of events that the Hook triggers for.
`remove_events`|`array` | Determines a list of events to be removed from the list of events that the Hook triggers for.
@@ -205,14 +205,12 @@ Name | Type | Description
``hub.mode``|`string` | **Required**. Either `subscribe` or `unsubscribe`.
``hub.topic``|`string` |**Required**. The URI of the GitHub repository to subscribe to. The path must be in the format of `/:owner/:repo/events/:event`.
``hub.callback``|`string` | The URI to receive the updates to the topic.
-``hub.secret``|`string` | A shared secret key that generates a SHA1 HMAC of the outgoing body content. You can verify a push came from GitHub by comparing the raw request body with the contents of the `X-Hub-Signature` header. You can see [our Ruby implementation][ruby-secret], or [the PubSubHubbub documentation][pshb-secret] for more details.
+``hub.secret``|`string` | A shared secret key that generates a SHA1 HMAC of the outgoing body content. You can verify a push came from GitHub by comparing the raw request body with the contents of the `X-Hub-Signature` header. You can see [the PubSubHubbub documentation][pshb-secret] for more details.
[guid]: http://en.wikipedia.org/wiki/Globally_unique_identifier
[pubsub]: https://github.com/pubsubhubbub/PubSubHubbub
[post-receive]: http://help.github.com/post-receive-hooks/
-[ruby-secret]: https://github.com/github/github-services/blob/14f4da01ce29bc6a02427a9fbf37b08b141e81d9/lib/services/web.rb#L47-L50
-[hub-signature]: https://github.com/github/github-services/blob/f3bb3dd780feb6318c42b2db064ed6d481b70a1f/lib/service/http_helper.rb#L77
[pshb-secret]: https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html#authednotify
[events-url]: /webhooks/#events
[ping-event-url]: /webhooks/#ping-event
diff --git a/content/v3/repos/invitations.md b/content/v3/repos/invitations.md
new file mode 100644
index 0000000000..50469923aa
--- /dev/null
+++ b/content/v3/repos/invitations.md
@@ -0,0 +1,98 @@
+---
+title: Repository Invitations
+---
+
+# Repository Invitations
+
+{{#tip}}
+
+We're currently offering a preview of the Repository Invitations API.
+
+To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+```
+application/vnd.github.swamp-thing-preview+json
+```
+
+{{/tip}}
+
+{:toc}
+
+
+
+## Invite a user to a repository
+
+Use the API endpoint for adding a collaborator [here](/v3/repos/collaborators).
+
+
+
+## List invitations for a repository
+
+ GET /repositories/:repo_id/invitations
+
+When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations.
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:repository_invitation) { |h| [h] } %>
+
+
+
+## Delete a repository invitation
+
+ DELETE /repositories/:repo_id/invitations/:invitation_id
+
+### Response
+
+<%= headers 204 %>
+
+
+
+## Update a repository invitation
+
+ PATCH /repositories/:repo_id/invitations/:invitation_id
+
+### Input
+
+Name | Type | Description
+-----|------|--------------
+`permissions`|`string` | The permissions that the associated user will have on the repository. Valid values are `read`, `write`, and `admin`.
+
+### Response
+
+<%= headers 200 %>
+<%= json(:repository_invitation) %>
+
+
+
+## List a user's repository invitations
+
+ GET /user/repository_invitations
+
+When authenticating as a user, this endpoint will list all currently open repository invitations for that user.
+
+### Response
+
+<%= headers 200 %>
+<%= json(:repository_invitation) { |h| [h] } %>
+
+
+
+## Accept a repository invitation
+
+ PATCH /user/repository_invitations/:invitation_id
+
+### Response
+
+<%= headers 204 %>
+
+
+
+## Decline a repository invitation
+
+ DELETE /user/repository_invitations/:invitation_id
+
+### Response
+
+<%= headers 204 %>
diff --git a/content/v3/repos/pages.md b/content/v3/repos/pages.md
index b088606a33..78f8c5ba94 100644
--- a/content/v3/repos/pages.md
+++ b/content/v3/repos/pages.md
@@ -6,13 +6,14 @@ title: Pages
{:toc}
-The Pages API retrieves information about your GitHub Pages configuration, and
+The GitHub Pages API retrieves information about your GitHub Pages configuration, and
the statuses of your builds. Information about the site and the builds can only be
accessed by authenticated owners, even though the websites are public.
In JSON responses, `status` can be one of:
* `null`, which means the site has yet to be built
+* `queued`, which means the build has been requested but not yet begun
* `building`, which means the build is in progress
* `built`, which means the site has been built
* `errored`, which indicates an error occurred during the build
@@ -21,11 +22,60 @@ In JSON responses, `status` can be one of:
GET /repos/:owner/:repo/pages
+{% if page.version == 'dotcom' or page.version > 2.7 %}
+
+{{#tip}}
+
+
+
+ Additional functionality of the GitHub Pages API is currently available for developers to preview.
+ During the preview period, the API may change without advance notice.
+
+ To access the additional functionality during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.mister-fantastic-preview+json
+
+ When the [preview flag](#preview-period) is passed, the response will contain an additional field, `html_url`, which will contain the absolute URL (with scheme) to the rendered site (e.g., `https://username.github.io`, or `http://example.com`).
+
+{{/tip}}
+
+{% endif %}
+
### Response
<%= headers 200 %>
<%= json(:pages) %>
+{% if page.version == 'dotcom' or page.version > 2.7 %}
+
+## Request a page build
+
+ POST /repos/:owner/:repo/pages/builds
+
+{{#tip}}
+
+
+
+ This endpoint is currently available for developers to preview.
+ During the preview period, the API may change without advance notice.
+
+ To access this endpoint during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.mister-fantastic-preview+json
+
+{{/tip}}
+
+You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.
+
+Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes.
+
+### Response
+
+<%= headers 200 %>
+<%= json(:pages_request_build) %>
+
+{% endif %}
+
## List Pages builds
GET /repos/:owner/:repo/pages/builds
diff --git a/content/v3/repos/pre_receive_hooks.md b/content/v3/repos/pre_receive_hooks.md
new file mode 100644
index 0000000000..2eef1d9459
--- /dev/null
+++ b/content/v3/repos/pre_receive_hooks.md
@@ -0,0 +1,88 @@
+---
+title: Repository Pre-receive Hooks
+---
+
+# Repository Pre-receive Hooks (Enterprise)
+
+{{#tip}}
+
+
+
+ APIs for managing pre-receive hooks are currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.eye-scream-preview
+
+{{/tip}}
+
+
+{:toc}
+
+The Repository Pre-receive Hooks API allows you to view and modify
+enforcement of the pre-receive hooks that are available to a repository.
+
+Prefix all the endpoints for this API with the following URL:
+
+``` command-line
+http(s)://hostname/api/v3
+```
+
+## Object attributes
+
+| Name | Type | Description |
+|---------------------|----------|-----------------------------------------------------------|
+| `name` | `string` | The name of the hook. |
+| `enforcement` | `string` | The state of enforcement for the hook on this repository. |
+| `configuration_url` | `string` | URL for the endpoint where enforcement is set. |
+
+Possible values for *enforcement* are `enabled`, `disabled` and`testing`. `disabled` indicates the pre-receive hook will not run. `enabled` indicates it will run and reject
+any pushes that result in a non-zero status. `testing` means the script will run but will not cause any pushes to be rejected.
+
+`configuration_url` may be a link to this repository, it's organization
+owner or global configuration. Authorization to access the endpoint at
+`configuration_url` is determined at the owner or site admin level.
+
+## List pre-receive hooks
+
+List all pre-receive hooks that are enabled or testing for this
+repository as well as any disabled hooks that are allowed to be enabled
+at the repository level. Pre-receive hooks that are disabled at a higher
+level and are not configurable will not be listed.
+
+ GET /repos/:owner/:repo/pre-receive-hooks
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json :pre_receive_hooks_repo %>
+
+## Get a single pre-receive hook
+
+ GET /repos/:owner/:repo/pre-receive-hooks/:id
+
+<%= headers 200 %> <%= json :pre_receive_hook_repo %>
+
+## Update pre-receive hook enforcement
+
+For pre-receive hooks which are allowed to be configured at the repo level, you can set `enforcement`
+
+ PATCH /repos/:owner/:repo/pre-receive-hooks/:id
+
+<%= json :enforcement => "enabled" %>
+
+### Response
+
+<%= headers 200 %><%= json :pre_receive_hook_repo_update %>
+
+## Remove enforcement overrides for a pre-receive hook
+
+Deletes any overridden enforcement on this repository for the specified
+hook.
+
+ DELETE /repos/:owner/:repo/pre-receive-hooks/:id
+
+### Response
+
+Responds with effective values inherited from owner and/or global level.
+
+<%= headers 200 %> <%= json :pre_receive_hook_repo %>
diff --git a/content/v3/repos/releases.md b/content/v3/repos/releases.md
index 7d792e19cc..73a2e10891 100644
--- a/content/v3/repos/releases.md
+++ b/content/v3/repos/releases.md
@@ -196,10 +196,9 @@ This may leave an empty asset with a state of `"new"`. It can be safely deleted
{{#tip}}
-If you want to download the asset's binary content, pass a media type of
-`"application/octet-stream"`. The API will either redirect the client to the
-location, or stream it directly if possible. API clients should handle both a
-`200` or `302` response.
+To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://developer.github.com/v3/media/#media-types).
+The API will either redirect the client to the location, or stream it directly if possible.
+API clients should handle both a `200` or `302` response.
{{/tip}}
diff --git a/content/v3/repos/traffic.md b/content/v3/repos/traffic.md
new file mode 100644
index 0000000000..483197db77
--- /dev/null
+++ b/content/v3/repos/traffic.md
@@ -0,0 +1,79 @@
+---
+title: Traffic
+---
+
+# Traffic
+{{#tip}}
+
+
+
+ APIs for repository traffic are currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-08-15-traffic-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.spiderman-preview
+
+{{/tip}}
+
+{:toc}
+
+For repositories that you have push access to, the traffic API provides access
+to the information provided in the [graphs section](https://help.github.com/articles/about-repository-graphs/#traffic).
+
+
+
+## List referrers
+
+Get the top 10 referrers over the last 14 days.
+
+ GET /repos/:owner/:repo/traffic/popular/referrers
+
+### Response
+
+<%= headers 200 %>
+<%= json(:traffic_referrers) %>
+
+## List paths
+
+Get the top 10 popular contents over the last 14 days.
+
+ GET /repos/:owner/:repo/traffic/popular/paths
+
+### Response
+
+<%= headers 200%>
+<%= json(:traffic_contents) %>
+
+## Views
+
+Get the total number of views and breakdown per day or week for the last 14 days.
+
+ GET /repos/:owner/:repo/traffic/views
+
+### Parameters
+Name | Type | Description
+-----|------|--------------
+`per`|string|Must be one of: `day`, `week`. Default: `day`
+
+
+### Response
+<%= headers 200 %>
+<%= json(:traffic_views) %>
+
+## Clones
+
+Get the total number of clones and breakdown per day or week for the last 14 days.
+
+ GET /repos/:owner/:repo/traffic/clones
+
+### Parameters
+Name | Type | Description
+-----|------|--------------
+`per`|string|Must be one of: `day`, `week`. Default: `day`
+
+### Response
+
+<%= headers 200 %>
+<%= json(:traffic_clones) %>
diff --git a/content/v3/search.md b/content/v3/search.md
index 05ca2781c1..bfdefdd175 100644
--- a/content/v3/search.md
+++ b/content/v3/search.md
@@ -25,6 +25,8 @@ is a computed value representing the relevance of an item relative to the other
items in the result set. Multiple factors are combined to boost the most
relevant item to the top of the result list.
+{% if page.version == 'dotcom' %}
+
### Rate limit
The Search API has a custom rate limit. For requests using [Basic
@@ -36,6 +38,8 @@ to make up to 10 requests per minute.
See the [rate limit documentation](/v3/#rate-limiting) for details on
determining your current rate limit status.
+{% endif %}
+
### Timeouts and incomplete results
To keep the Search API fast for everyone, we limit how long any individual query
@@ -93,7 +97,7 @@ repositories where the primary language is Assembly. We're sorting by stars in
descending order, so that the most popular repositories appear first in the
search results.
-<%= headers 200, {:pagination => default_pagination_rels, 'X-RateLimit-Limit' => 20, 'X-RateLimit-Remaining' => 19} %>
+<%= headers 200, {:pagination => default_pagination_rels{% if page.version == 'dotcom' %}, 'X-RateLimit-Limit' => 20, 'X-RateLimit-Remaining' => 19{% endif %}} %>
<%= json(:repo_search_v3_results) %>
### Highlighting Repository Search Results
@@ -182,7 +186,7 @@ Here, we're searching for the keyword `addClass` within a file's contents. We're
making sure that we're only looking in files where the language is JavaScript.
And we're scoping the search to the `repo:jquery/jquery` repository.
-<%= headers 200, {:pagination => default_pagination_rels, 'X-RateLimit-Limit' => 20, 'X-RateLimit-Remaining' => 19} %>
+<%= headers 200, {:pagination => default_pagination_rels,{% if page.version == 'dotcom' %} 'X-RateLimit-Limit' => 20, 'X-RateLimit-Remaining' => 19{% endif %}} %>
<%= json(:code_search_v3_results) %>
### Highlighting Code Search Results
@@ -285,7 +289,7 @@ that's labeled as `bug`. The search runs across repositories whose primary
language is Python. We’re sorting by creation date in ascending order, so that
the oldest issues appear first in the search results.
-<%= headers 200, {:pagination => default_pagination_rels, 'X-RateLimit-Limit' => 20, 'X-RateLimit-Remaining' => 19} %>
+<%= headers 200, {:pagination => default_pagination_rels,{% if page.version == 'dotcom' %} 'X-RateLimit-Limit' => 20, 'X-RateLimit-Remaining' => 19{% endif %}} %>
<%= json(:issue_search_v3_results) %>
### Highlighting Issue Search Results
@@ -357,7 +361,7 @@ Imagine you're looking for a list of popular users. You might try out this query
Here, we're looking at users with the name Tom. We're only interested in those
with more than 42 repositories, and only if they have over 1,000 followers.
-<%= headers 200, {:pagination => default_pagination_rels, 'X-RateLimit-Limit' => 20, 'X-RateLimit-Remaining' => 19} %>
+<%= headers 200, {:pagination => default_pagination_rels,{% if page.version == 'dotcom' %} 'X-RateLimit-Limit' => 20, 'X-RateLimit-Remaining' => 19{% endif %}} %>
<%= json(:user_search_v3_results) %>
### Highlighting User Search Results
diff --git a/content/v3/troubleshooting.md b/content/v3/troubleshooting.md
index 9536fd7373..09a0d04864 100644
--- a/content/v3/troubleshooting.md
+++ b/content/v3/troubleshooting.md
@@ -20,7 +20,7 @@ To troubleshoot, ensure [you're authenticating correctly](/guides/getting-starte
## Why am I not seeing all my results?
-Most API calls accessing a list of resources (_e.g._, users, issues, _e.t.c._) support
+Most API calls accessing a list of resources (_e.g._, users, issues, _etc._) support
pagination. If you're making requests and receiving an incomplete set of results, you're
probably only seeing the first page. You'll need to request the remaining pages
in order to get more results.
diff --git a/content/v3/users.md b/content/v3/users.md
index d8caa605d1..11e5479a4c 100644
--- a/content/v3/users.md
+++ b/content/v3/users.md
@@ -68,7 +68,7 @@ Name | Type | Description
## Get all users
-Lists all users, in the order that they signed up on {{ site.data.variables.product.product_name }}.
+Lists all users, in the order that they signed up on {{ site.data.variables.product.product_name }}. This list includes personal user accounts and organization accounts.
Note: Pagination is powered exclusively by the `since` parameter.
Use the [Link header](/v3/#link-header) to get the URL for the next page of
diff --git a/content/v3/users/gpg_keys.md b/content/v3/users/gpg_keys.md
index 935f7ecab3..448737dc56 100644
--- a/content/v3/users/gpg_keys.md
+++ b/content/v3/users/gpg_keys.md
@@ -16,7 +16,7 @@ title: User GPG Keys
To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
- application/vnd.github.cryptographer-preview+sha
+ application/vnd.github.cryptographer-preview
{{/tip}}
diff --git a/content/v3/versions.md b/content/v3/versions.md
index e9112368d7..53c7cf6f33 100644
--- a/content/v3/versions.md
+++ b/content/v3/versions.md
@@ -145,6 +145,11 @@ The recommendations below will help you prepare your application for the next ma
Recommendation: This attribute no longer dictates the permission a team has on its repositories; it only dictates the default permission that the [Add or update team repository](/v3/orgs/teams/#add-or-update-team-repository) API will use for requests where no `permission` attribute is specified. To change the permission level for every repository on a team, use the [List team repositories](/v3/orgs/teams/#list-team-repos) API to list all of the team's repositories, and then use the [Add or update team repository](/v3/orgs/teams/#add-or-update-team-repository) with a `permission` attribute to update each repository's permission separately.
+1. Issue attribute: assignee
+
+ Recommendation: Use the [`assignees`](https://developer.github.com/v3/issues/#create-an-issue) key instead, since issues can have more than one assignee. Alternatively, you can use the
+ [assignees](https://developer.github.com/v3/issues/assignees/) endpoints.
+
# beta (Deprecated)
diff --git a/content/webhooks/index.md b/content/webhooks/index.md
index 76fea2de20..03fc42d1ca 100644
--- a/content/webhooks/index.md
+++ b/content/webhooks/index.md
@@ -50,7 +50,7 @@ Name | Description
[`gollum`][event-types-gollum] | Any time a Wiki page is updated.
[`issue_comment`][event-types-issue_comment] | {% if page.version == 'dotcom' or page.version > 2.6 %}Any time a [comment on an issue](/v3/issues/comments/) is created, edited, or deleted.{% else %}Any time an [issue is commented on](/v3/issues/comments).{% endif %}
[`issues`][event-types-issues] | Any time an Issue is assigned, unassigned, labeled, unlabeled, opened, {% if page.version == 'dotcom' or page.version > 2.6 %}edited, {% endif %}closed, or reopened.
-[`member`][event-types-member] | Any time a User is added as a collaborator to a non-Organization Repository.
+[`member`][event-types-member] | Any time a User is added as a collaborator to a Repository.
[`membership`][event-types-membership] | Any time a User is added or removed from a team. **Organization hooks only**.
[`page_build`][event-types-page_build] | Any time a Pages site is built or results in a failed build.
[`public`][event-types-public] | Any time a Repository changes from private to public.
@@ -154,42 +154,10 @@ zen | Random string of GitHub zen |
hook_id | The ID of the webhook that triggered the ping |
hook | The [webhook configuration][repo-hooks-show] |
-
-## Service Hooks
-
-In addition to webhooks, we also offer the ability to install pre-rolled
-integrations for a variety of existing services. These services [are contributed
-and maintained by the Open Source community][github-services].
-
-Service hooks are installed and configured in a similar fashion as webhooks.
-When [creating a hook][webhooks-guide-create], just set the `:name` parameter to
-a service name instead of "web" (for webhook). The main differences to keep in
-mind between webhooks and service hooks are:
-
-- Service hooks cannot be installed on organizations, only repositories.
-- You can only install a one service per integrator for a repository, whereas
- multiple webhooks can be installed on each organization/repository.
-- Each service hook only supports a specific set of events, depending on the
- services implementation.
-- Each service has its own unique set of configuration options.
-
-To see a full list of available services, their supported events, and
-configuration options, check out https://api.github.com/hooks. Documentation for all
-service hooks can be found in the [docs directory][github-services-docs] of the
-github-services repository.
-
-**Note:** If you are building a new integration, you should build it as webhook.
-We suggest creating an [OAuth application][oauth-applications] to automatically
-install and manage your users' webhooks. We will no longer be accepting new
-services to the [github-services repository][github-services].
-
-
[service-hooks-section]: #service-hooks
[events-section]: #events
[wildcard-section]: #wildcard-event
[payloads-section]: #payloads
-[webhooks-guide-create]: /webhooks/creating/
[org-hooks]: /v3/orgs/hooks/
[repo-hooks]: /v3/repos/hooks/
[repo-hooks-show]: /v3/repos/hooks/#get-single-hook
@@ -218,6 +186,3 @@ services to the [github-services repository][github-services].
[event-types-status]: /v3/activity/events/types/#statusevent
[event-types-team_add]: /v3/activity/events/types/#teamaddevent
[event-types-watch]: /v3/activity/events/types/#watchevent
-[github-services]: https://github.com/github/github-services
-[github-services-docs]: https://github.com/github/github-services/tree/master/docs
-[oauth-applications]: /v3/oauth/
diff --git a/content/webhooks/securing.md b/content/webhooks/securing.md
index 8f2706b83a..407ea1f26b 100644
--- a/content/webhooks/securing.md
+++ b/content/webhooks/securing.md
@@ -31,7 +31,7 @@ $ export SECRET_TOKEN=your_token
## Validating payloads from GitHub
-When your secret token is set, GitHub uses it to create a hash signature with each payload. You can find details on the implementation [in our Ruby implementation][ruby-secret].
+When your secret token is set, GitHub uses it to create a hash signature with each payload.
This hash signature is passed along with each request in the headers as `X-Hub-Signature`. Suppose you have a basic server listening to webhooks that looks like this:
@@ -68,5 +68,4 @@ Obviously, your language and server implementations may differ than this code. T
* Using a plain `==` operator is **not advised**. A method like [`secure_compare`][secure_compare] performs a "constant time" string comparison, which renders it safe from certain timing attacks against regular equality operators.
-[ruby-secret]: https://github.com/github/github-services/blob/14f4da01ce29bc6a02427a9fbf37b08b141e81d9/lib/services/web.rb#L47-L50
[secure_compare]: http://rubydoc.info/github/rack/rack/master/Rack/Utils.secure_compare
diff --git a/layouts/sidebar.html b/layouts/sidebar.html
index c179fd3fc7..46f010e310 100644
--- a/layouts/sidebar.html
+++ b/layouts/sidebar.html
@@ -47,6 +47,9 @@