---
title: "Get team membership for a user"
method: GET
path: "/orgs/{org}/teams/{team_slug}/memberships/{username}"
tags: ["teams"]
---

# Get team membership for a user

`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).

## Path parameters

- `org` string, required
- `team_slug` string, required
- `username` string, required

## Response `200`

Response

- TeamMembership — Team Membership
  - `url` string, uri, required
  - `role` 'member' | 'maintainer', required — The role of the user in the team.
  - `state` 'active' | 'pending', required — The state of the user's membership in the team.

## Other responses

- `404` — if user has no team membership

---

[API](https://skmtc.net/github/apis/api-github-com.md) · [All operations](https://skmtc.net/github/apis/api-github-com/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/api-github-com/revisions/312a80145102/schema)
