Check if a user is a repository collaborator
For 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.
Path Parameters
Response
Response
Response if user is a collaborator
Path Parameters
Add a repository collaborator
This 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.
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:
Cannot assign {member} permission of {role name}
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 repository invitations API endpoints.
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.
Path Parameters
Body
application/json
Body
The permission to grant the collaborator. Only valid on organization-owned repositories. Can be one of:
* pull
- can pull, but not push to or administer this repository.
* push
- can pull and push, but not administer this repository.
* admin
- can pull, push and administer this repository.
* maintain
- Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.
* triage
- Recommended for contributors who need to proactively manage issues and pull requests without write access.
Allowed values:pullpushadminmaintaintriage
Default:push
Example:"push"
Response
application/json
Response
Response when a new invitation is created
Repository Invitation
Repository invitations let you manage who you collaborate with.
Unique identifier of the repository invitation.
Example:42
Minimal Repository
Show Child Parameters
Simple User
Show Child Parameters
Simple User
Show Child Parameters
The permission associated with the invitation.
Allowed values:readwriteadmintriagemaintain
Example:read
Example:2016-06-13T14:52:50-05:00
Whether or not the invitation has expired
URL for the repository invitation
Example:https://api.github.com/user/repository-invitations/1
Example:https://github.com/octocat/Hello-World/invitations
Path Parameters
Body
Remove a repository collaborator
Path Parameters
Response
204
Response
Response
Path Parameters
Get repository permissions for a user
Checks the repository permission of a collaborator. The possible repository permissions are admin
, write
, read
, and none
.
Path Parameters
Response
application/json
Response
if user has admin permissions
Repository Collaborator Permission
Repository Collaborator Permission
Collaborator
Show Child Parameters
Path Parameters
List commit comments for a repository
Commit Comments use these custom media types. You can read more about the use of media types in the API here.
Comments are ordered by ascending ID.
Query Parameters
Results per page (max 100)
Default:30
Page number of the results to fetch.
Default:1
Path Parameters
Response
200 application/json
Response
Response
Commit Comment
Simple User
Show Child Parameters
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER