Codes of Conduct

The Codes of Conduct API is currently available for developers to preview. During the preview period, the API may change without advance notice.

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

List all codes of conduct

GET /codes_of_conduct

Response

Status: 200 OK
[
  {
    "key": "citizen_code_of_conduct",
    "name": "Citizen Code of Conduct",
    "url": "https://api.github.com/codes_of_conduct/citizen_code_of_conduct"
  },
  {
    "key": "contributor_covenant",
    "name": "Contributor Covenant",
    "url": "https://api.github.com/codes_of_conduct/contributor_covenant"
  }
]

Get an individual code of conduct

GET /codes_of_conduct/:key

Response

Status: 200 OK
{
  "key": "contributor_covenant",
  "name": "Contributor Covenant",
  "url": "https://api.github.com/codes_of_conduct/contributor_covenant",
  "body": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment include:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\n                  to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\n                  posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n"
}

Get a repository's code of conduct

When passed the preview media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file.

GET /repos/:owner/:repo

Response

Status: 200 OK
{
  "id": 88760408,
  "name": "cosee",
  "full_name": "LindseyB/cosee",
  "owner": {
    "login": "LindseyB",
    "id": 33750,
    "avatar_url": "https://avatars2.githubusercontent.com/u/33750?v=3",
    "gravatar_id": "",
    "url": "https://api.github.com/users/LindseyB",
    "html_url": "https://github.com/LindseyB",
    "followers_url": "https://api.github.com/users/LindseyB/followers",
    "following_url": "https://api.github.com/users/LindseyB/following{/other_user}",
    "gists_url": "https://api.github.com/users/LindseyB/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/LindseyB/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/LindseyB/subscriptions",
    "organizations_url": "https://api.github.com/users/LindseyB/orgs",
    "repos_url": "https://api.github.com/users/LindseyB/repos",
    "events_url": "https://api.github.com/users/LindseyB/events{/privacy}",
    "received_events_url": "https=>//api.github.com/users/LindseyB/received_events",
    "type": "User",
    "site_admin": true
  },
  "private": false,
  "html_url": "https://github.com/LindseyB/cosee",
  "description": null,
  "fork": false,
  "url": "https://api.github.com/repos/LindseyB/cosee",
  "forks_url": "https://api.github.com/repos/LindseyB/cosee/forks",
  "keys_url": "https://api.github.com/repos/LindseyB/cosee/keys{/key_id}",
  "collaborators_url": "https://api.github.com/repos/LindseyB/cosee/collaborators{/collaborator}",
  "teams_url": "https://api.github.com/repos/LindseyB/cosee/teams",
  "hooks_url": "https://api.github.com/repos/LindseyB/cosee/hooks",
  "issue_events_url": "https://api.github.com/repos/LindseyB/cosee/issues/events{/number}",
  "events_url": "https://api.github.com/repos/LindseyB/cosee/events",
  "assignees_url": "https://api.github.com/repos/LindseyB/cosee/assignees{/user}",
  "branches_url": "https://api.github.com/repos/LindseyB/cosee/branches{/branch}",
  "tags_url": "https://api.github.com/repos/LindseyB/cosee/tags",
  "blobs_url": "https://api.github.com/repos/LindseyB/cosee/git/blobs{/sha}",
  "git_tags_url": "https://api.github.com/repos/LindseyB/cosee/git/tags{/sha}",
  "git_refs_url": "https://api.github.com/repos/LindseyB/cosee/git/refs{/sha}",
  "trees_url": "https://api.github.com/repos/LindseyB/cosee/git/trees{/sha}",
  "statuses_url": "https://api.github.com/repos/LindseyB/cosee/statuses/{sha}",
  "languages_url": "https://api.github.com/repos/LindseyB/cosee/languages",
  "stargazers_url": "https://api.github.com/repos/LindseyB/cosee/stargazers",
  "contributors_url": "https://api.github.com/repos/LindseyB/cosee/contributors",
  "subscribers_url": "https://api.github.com/repos/LindseyB/cosee/subscribers",
  "subscription_url": "https://api.github.com/repos/LindseyB/cosee/subscription",
  "commits_url": "https://api.github.com/repos/LindseyB/cosee/commits{/sha}",
  "git_commits_url": "https://api.github.com/repos/LindseyB/cosee/git/commits{/sha}",
  "comments_url": "https://api.github.com/repos/LindseyB/cosee/comments{/number}",
  "issue_comment_url": "https://api.github.com/repos/LindseyB/cosee/issues/comments{/number}",
  "contents_url": "https://api.github.com/repos/LindseyB/cosee/contents/{+path}",
  "compare_url": "https://api.github.com/repos/LindseyB/cosee/compare/{base}...{head}",
  "merges_url": "https://api.github.com/repos/LindseyB/cosee/merges",
  "archive_url": "https://api.github.com/repos/LindseyB/cosee/{archive_format}{/ref}",
  "downloads_url": "https://api.github.com/repos/LindseyB/cosee/downloads",
  "issues_url": "https://api.github.com/repos/LindseyB/cosee/issues{/number}",
  "pulls_url": "https://api.github.com/repos/LindseyB/cosee/pulls{/number}",
  "milestones_url": "https://api.github.com/repos/LindseyB/cosee/milestones{/number}",
  "notifications_url": "https://api.github.com/repos/LindseyB/cosee/notifications{?since,all,participating}",
  "labels_url": "https://api.github.com/repos/LindseyB/cosee/labels{/name}",
  "releases_url": "https://api.github.com/repos/LindseyB/cosee/releases{/id}",
  "deployments_url": "https://api.github.com/repos/LindseyB/cosee/deployments",
  "created_at": "2017-04-19T15=>23=>26Z",
  "updated_at": "2017-04-19T15=>23=>26Z",
  "pushed_at": "2017-04-19T15=>34=>03Z",
  "git_url": "git://github.com/LindseyB/cosee.git",
  "ssh_url": "git@github.com=>LindseyB/cosee.git",
  "clone_url": "https://github.com/LindseyB/cosee.git",
  "svn_url": "https://github.com/LindseyB/cosee",
  "homepage": null,
  "size": 1,
  "stargazers_count": 0,
  "watchers_count": 0,
  "language": null,
  "has_issues": true,
  "has_projects": true,
  "has_downloads": true,
  "has_wiki": true,
  "has_pages": false,
  "forks_count": 0,
  "mirror_url": null,
  "open_issues_count": 0,
  "forks": 0,
  "open_issues": 0,
  "watchers": 0,
  "default_branch": "master",
  "code_of_conduct": {
    "key": "contributor_covenant",
    "name": "Contributor Covenant",
    "url": "https://github.com/LindseyB/cosee/blob/master/CODE_OF_CONDUCT.md"
  },
  "network_count": 0,
  "subscribers_count": 0
}

Get the contents of a repository's code of conduct

This method returns the contents of the repository's code of conduct file, if one is detected.

GET /repos/:owner/:repo/community/code_of_conduct

Response

Status: 200 OK
{
  "key": "contributor_covenant",
  "name": "Contributor Covenant",
  "url": "https://github.com/LindseyB/cosee/blob/master/CODE_OF_CONDUCT.md",
  "body": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment include=>\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include=>\n\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\nto any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\nposting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at lindseyb@github.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n"
}