Skip to content

Instantly share code, notes, and snippets.

@jadia
Created July 9, 2019 07:12
Show Gist options
  • Save jadia/69e0c77275a721fbccad0fee5a05a656 to your computer and use it in GitHub Desktop.
Save jadia/69e0c77275a721fbccad0fee5a05a656 to your computer and use it in GitHub Desktop.
Get all team members list using Github API v3

Get list of all the teams in your organization

GITHUB_TOKEN=<YOUR-GITHUB-TOKEN-WITH-org:read-CHECKED>
GITHUB_ORG=<YOUR ORGANIZATION>
curl -sH "Authorization: token $GITHUB_TOKEN" https://api.github.com/orgs/$GITHUB_ORG/teams\?per_page\=100

Note the "id": for the Team of your choice Ex: "id": 68705"

Get the team member list:

GITHUB_TEAM_ID=68705
curl -sH "Authorization: token $GITHUB_TOKEN" https://api.github.com/teams/$GITHUB_TEAM_ID/members\?per_page\=100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment