List collaborators API v4

I know that it is possible to get the list of collaborators using REST API version 3, but I wonder if it is possible to get this information using the GraphQL API V4? If so, how I can do that?

Hi @moara,

Thank you for being here! Yes, you can use:

query {
  repository(owner: "peek", name: "peek") {
    id
    name

    collaborators(first: 10, affiliation: ALL) {
      edges {
        permission
        node {
          id
          login
          name
        }
      }
    }
  }

  rateLimit {
    cost
  }
}

Note: You must have push access to the repository before you can view the collaborators, otherwise it will return a forbidden error.

Here is a link to the documentation. I hope this helps!

Best,
Adrea

2 Likes

Hi @andreagriffiths11,

I am updating an application that made use of the REST v3 API. Is there a reason for restricting the information available in the v3 API to push access in v4? Are there more changes to calls based on permissions that would hamper users from migrating to the v4?