Sample - GitHub REST API
GET/repos/{owner}/{repo}/collaborators/{username}

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.

The authenticated user must have push access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the read:org and repo scopes to use this endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
usernamestringrequired
The handle for the GitHub user account.

2 status codes
204Response if user is a collaborator
404Not Found if user is not a collaborator

Error handling

A 404 is returned: Not Found if user is not a collaborator.