GraphQL API: How to fetch all orgs that the oauth token has access to

Hi,

  I authenticate use OAuth token or user.

  Is there any way to list all orgs that the user has access to or  OAuth token is given access to?

Thanks

You can use the following query to find the organizations the currently logged-in user is a member of:

{
  viewer {
    organizations(first: 100) {
      nodes {
        login
        name
      }
    }
  }
}

I hope that helps!

1 Like