provider teams GET /orgs/{org}/teams/{team_slug}/memberships/{username}
@utdk/github /orgs/{org}/teams/{team_slug}/memberships/{username}
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_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. > [!NOTE] > The response contains the `state` of the membership and the member's `role`. The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team).
org path required
The organization name. The name is not case sensitive.
string
team_slug path required
The slug of the team name.
string
username path required
The handle for the GitHub user account.
string

Try it

Authentication
Configure credentials for GitHub v3 REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

teams.getMembershipForUserInOrg
GET/orgs/{org}/teams/{team_slug}/memberships/{username}
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_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. > [!NOTE] > The response contains the `state` of the membership and the member's `role`. The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team).

Parameters

required

The organization name. The name is not case sensitive.

required

The slug of the team name.

required

The handle for the GitHub user account.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import github from '@utdk/github';

await github.teams.getMembershipForUserInOrg()