Get team membership for a user
Team members will include the members of child teams.
To get a user’s membership with a team, the team must be visible to the authenticated user.
[!NOTE] You can also specify a team by
org_idandteam_idusing the routeGET /organizations/{org_id}/team/{team_id}/memberships/{username}.
[!NOTE] The response contains the
stateof the membership and the member’srole.
The role for organization owners is set to maintainer. For more information about maintainer roles, see Create a team.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The organization name. The name is not case sensitive.
The slug of the team name.
The handle for the GitHub user account.
Responses
Section titled “ Responses ”Response
Team Membership
object
The role of the user in the team.
The state of the user’s membership in the team.
Examples
Response if user is a team maintainer
{ "url": "https://api.github.com/teams/1/memberships/octocat", "role": "maintainer", "state": "active"}If user has no team membership