Alternatively, a faster solution, you can use the memberships API to get detailed information about the authenticated user membership in each organization to which they belong.
The request is just GET /user/memberships/orgs?state=active , and the answer is as follows:
[ { "state": "active", "role": "admin", "organization": { "login": "octocat", "id": 1, }, "user": { "login": "defunkt", "id": 3, "gravatar_id": "", "type": "User", "site_admin": false } }, { "state": "active", "role": "member", "organization": { "login": "invitocat", "id": 2, }, "user": { "login": "defunkt", "id": 3, "gravatar_id": "", "type": "User", "site_admin": false } } ]
An important field for designation is the role ; we want only "role": "admin" .
Iโm not sure if this ensures that the user is a member of Owners , but it does indicate that they have the administrative authority of the organization.
namuol
source share