How can I view users with write permissions to repo through the github api?

I’ve tried using the collaborators attribute from the graphql api, but that only returns users, without their permissions.

The v3 api seemed like it would work with https://developer.github.com/v3/repos/collaborators/#list-collaborators, but this api call doesn’t appear to return all the users with write access to a repo. In my case, I’m a member of a team on the pytest-dev org, which has write permission to the pytest repo, but when I query https://api.github.com/repos/pytest-dev/pytest/collaborators, I do not see my user account.

How can I find users with write permissions to a repo through the github API? I need this to determine if a user’s review of a PR is meaningful, as only reviews from users with write permissions count.

Are you passing the hellcat-preview media type as described in the documentation.? I believe that is required to get the list of absolutely all collaborators, including ones on child teams.

I hope that helps!