Skip to main content

collaborators

Overview

Namecollaborators
TypeResource
Idgithub.repos.collaborators

Fields

NameDatatype
idinteger
namestring
avatar_urlstring
emailstring
events_urlstring
followers_urlstring
following_urlstring
gists_urlstring
gravatar_idstring
html_urlstring
loginstring
node_idstring
organizations_urlstring
permissionsobject
received_events_urlstring
repos_urlstring
role_namestring
site_adminboolean
starred_urlstring
subscriptions_urlstring
typestring
urlstring

Methods

NameAccessible byRequired ParamsDescription
list_collaboratorsSELECTowner, repoFor organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.
Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.

Team members will include the members of child teams.

You must authenticate using an access token with the read:org and repo scopes with push access to use this
endpoint. GitHub Apps must have the members organization permission and metadata repository permission to use this
endpoint.
remove_collaboratorDELETEowner, repo, usernameRemoves a collaborator from a repository.

To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.

This endpoint also:
- Cancels any outstanding invitations
- Unasigns the user from any issues
- Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories.
- Unstars the repository
- Updates access permissions to packages

Removing a user as a collaborator has the following effects on forks:
- If the user had access to a fork through their membership to this repository, the user will also be removed from the fork.
- If the user had their own fork of the repository, the fork will be deleted.
- If the user still has read access to the repository, open pull requests by this user from a fork will be denied.

Note: A user can still have access to the repository through organization permissions like base repository permissions.

Although the API responds immediately, the additional permission updates might take some extra time to complete in the background.

For more information on fork permissions, see "About permissions and visibility of forks".
add_collaboratorEXECowner, repo, usernameThis endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.

Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "Enforcing repository management policies in your enterprise."

For more information on permission levels, see "Repository permission levels for an organization". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:

<br />Cannot assign &#123;member&#125; permission of &#123;role name&#125;<br />

Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the API.

Updating an existing collaborator's permission level

The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different permission parameter. The response will be a 204, with no other indication that the permission level changed.

Rate limits

You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.
check_collaboratorEXECowner, repo, usernameFor organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.

Team members will include the members of child teams.

You must authenticate using an access token with the read:org and repo scopes with push access to use this
endpoint. GitHub Apps must have the members organization permission and metadata repository permission to use this
endpoint.