Preview Codes of Conduct API

We're introducing a new codes of conduct API preview to support the code of conduct adoption tool on GitHub.com.

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

application/vnd.github.scarlet-witch-preview+json

This will then expose new API endpoints. You can get a list of all known codes of conduct:

GET /codes_of_conduct

Or get a particular code of conduct:

GET /codes_of_conduct/citizen_code_of_conduct

When the preview media type is passed, the Repository API will also return information about a repository's code of conduct file when you get an individual repository:

GET /repos/github/hubot

Alternatively, you can just get the contents of a repository's code of conduct with:

GET /repos/github/hubot/community/code_of_conduct