Outside Collaborators

Note: The Organization Membership API on GitHub is currently available for developers to preview. To access the API you must provide a custom media type in the Accept header:

application/vnd.github.korra-preview

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub support.

List outside collaborators

List all users who are outside collaborators of an organization.

GET /orgs/:org/outside_collaborators

Parameters

Name Type Description
filter string Filter the list of outside collaborators. Can be one of:
* 2fa_disabled: Outside collaborators without two-factor authentication enabled.
* all: All outside collaborators.

Default: all

Response

Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
      <https://api.github.com/resource?page=5>; rel="last"
[
  {
    "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
  }
]

Remove outside collaborator

Removing a user from this list will remove them from all the organization's repositories.

DELETE /orgs/:org/outside_collaborator/:username

Response

Status: 204 No Content

Response if user is a member of the organization

Status: 422 Unprocessable Entity
{
  "message": "You cannot specify an organization member to remove as an outside collaborator.",
  "documentation_url": "https://developer.github.com/v3/orgs/outside_collaborators/#remove-outside-collaborator"
}

Convert member to outside collaborator

When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "Converting an organization member to an outside collaborator".

PUT /orgs/:org/outside_collaborator/:username

Response

Status: 204 No Content

Response if user is the last owner of the organization

Status: 403 Forbidden
{
  "message": "Cannot convert the last owner to an outside collaborator",
  "documentation_url": "https://developer.github.com/v3/orgs/outside_collaborators/#convert-member-to-outside-collaborator"
}

Response if user is not a member of the organization

Status: 403 Forbidden
{
  "message": "<user> is not a member of the <organization> organization.",
  "documentation_url": "https://developer.github.com/v3/orgs/outside_collaborators/#convert-member-to-outside-collaborator"
}