---
title: "Get team membership for a user (Legacy)"
method: GET
path: "/teams/{team_id}/memberships/{username}"
tags: ["teams"]
deprecated: true
---

# Get team membership for a user (Legacy)

`GET /teams/{team_id}/memberships/{username}`

> **Deprecated.**

> [!WARNING]
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/enterprise-cloud@latest/rest/teams/members#get-team-membership-for-a-user) endpoint.

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:**
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/enterprise-cloud@latest/rest/teams/teams#create-a-team).

## Path parameters

- `team_id` integer, 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` — Resource not found

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
