Skip to main content

This version of GitHub Enterprise was discontinued on 2022-06-03. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Codes of conduct

The Codes of conduct API lets you retrieve information about a repository's code of conduct.

About the Codes of conduct API

You can use the Codes of Conduct API to retrieve information about a repository's code of conduct. To get a code of conduct for a repository, use the "Get a repository" endpoint.

Get all codes of conduct

Works with GitHub Apps

HTTP response status codes

Status codeDescription
200

OK

304

Not modified

Code samples

get/codes_of_conduct
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/codes_of_conduct

Response

Status: 200
[ { "key": "citizen_code_of_conduct", "name": "Citizen Code of Conduct", "url": "https://api.github.com/codes_of_conduct/citizen_code_of_conduct", "html_url": "http://citizencodeofconduct.org/" }, { "key": "contributor_covenant", "name": "Contributor Covenant", "url": "https://api.github.com/codes_of_conduct/contributor_covenant", "html_url": "https://www.contributor-covenant.org/version/2/0/code_of_conduct/" } ]

Get a code of conduct

Works with GitHub Apps

Parameters

Headers
Name, Type, Description
acceptstring

Setting to application/vnd.github.v3+json is recommended.

Path parameters
Name, Type, Description
keystringRequired

HTTP response status codes

Status codeDescription
200

OK

304

Not modified

404

Resource not found

Code samples

get/codes_of_conduct/{key}
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ http(s)://HOSTNAME/api/v3/codes_of_conduct/KEY

Response