# Get team membership for a user (Legacy)

From **GitHub v3 REST API**.

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

**Deprecated.**

**Deprecation Notice:** This endpoint route is deprecated 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-server@3.0/rest/reference/teams#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-server@3.0/rest/reference/teams#create-a-team).

## Parameters

### `team_id`

- Location: path
- Required: true
- Type: `integer`

### `username`

- Location: path
- Required: true
- Type: `string`

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Team Membership

```json
{
  "role": "maintainer",
  "state": "active",
  "url": "https://api.github.com/teams/1/memberships/octocat"
}
```

```json
{"description":"Team Membership","properties":{"role":{"default":"member","description":"The role of the user in the team.","enum":["member","maintainer"],"example":"member","type":"string"},"state":{"description":"The state of the user's membership in the team.","enum":["active","pending"],"type":"string"},"url":{"format":"uri","type":"string"}},"required":["role","state","url"],"title":"Team Membership","type":"object"}
```

### `404`

Resource not found

### `application/json`

- Type: `object`

Basic Error

```json
{"description":"Basic Error","properties":{"documentation_url":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"title":"Basic Error","type":"object"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/teams/{team_id}/memberships/{username}
```
