Skip to content

Get team membership for a user (Legacy)

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

[!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 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.

API method documentation

team_id
required
integer

The unique identifier of the team.

username
required
string

The handle for the GitHub user account.

Response

Media type application/json
Team Membership

Team Membership

object
url
required
string format: uri
role
required

The role of the user in the team.

string
default: member
Allowed values: member maintainer
state
required

The state of the user’s membership in the team.

string
Allowed values: active pending
Examples
Example response-if-user-is-a-team-maintainer

Response if user is a team maintainer

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

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}