GitHub v3 REST API

List team members (Legacy)

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 List team members endpoint.

Team members will include the members of child teams.

get
{protocol}://{hostname}/api/v3/teams/{team_id}/members

Query Parameters

rolestring

Filters members returned by their role in the team. Can be one of:
* member - normal members of the team.
* maintainer - team maintainers.
* all - all members of the team.

Allowed values:membermaintainerall

Default:all

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

team_idintegerrequired

Response

application/json

Response

Simple User

namestring | null
emailstring | null
loginstringrequired

Example:octocat

idintegerrequired

Example:1

node_idstringrequired

Example:MDQ6VXNlcjE=

avatar_urlstring(uri)required

Example:https://github.com/images/error/octocat_happy.gif

gravatar_idstring | nullrequired

Example:41d064eb2195891e12d0413f63227ea7

urlstring(uri)required

Example:https://api.github.com/users/octocat

html_urlstring(uri)required

Example:https://github.com/octocat

followers_urlstring(uri)required

Example:https://api.github.com/users/octocat/followers

following_urlstringrequired

Example:https://api.github.com/users/octocat/following{/other_user}

gists_urlstringrequired

Example:https://api.github.com/users/octocat/gists{/gist_id}

starred_urlstringrequired

Example:https://api.github.com/users/octocat/starred{/owner}{/repo}

subscriptions_urlstring(uri)required

Example:https://api.github.com/users/octocat/subscriptions

organizations_urlstring(uri)required

Example:https://api.github.com/users/octocat/orgs

repos_urlstring(uri)required

Example:https://api.github.com/users/octocat/repos

events_urlstringrequired

Example:https://api.github.com/users/octocat/events{/privacy}

received_events_urlstring(uri)required

Example:https://api.github.com/users/octocat/received_events

typestringrequired

Example:User

site_adminbooleanrequired
starred_atstring

Example:"2020-07-09T00:17:55Z"

get/teams/{team_id}/members
 
application/json

Get team member (Legacy)

DEPRECATED

The “Get team member” endpoint (described below) is deprecated.

We recommend using the Get team membership for a user endpoint instead. It allows you to get both active and pending memberships.

To list members in a team, the team must be visible to the authenticated user.

get
{protocol}://{hostname}/api/v3/teams/{team_id}/members/{username}

Path Parameters

team_idintegerrequired
usernamestringrequired

Response

if user is a member

get/teams/{team_id}/members/{username}
 

Add team member (Legacy)

DEPRECATED

The “Add team member” endpoint (described below) is deprecated.

We recommend using the Add or update team membership for a user endpoint instead. It allows you to invite new organization members to your teams.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.

To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they’re changing. The person being added to the team must be a member of the team’s organization.

Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub Enterprise Server.”

Note that you’ll need to set Content-Length to zero when calling out to this endpoint. For more information, see “HTTP verbs.”

put
{protocol}://{hostname}/api/v3/teams/{team_id}/members/{username}

Path Parameters

team_idintegerrequired
usernamestringrequired

Response

Response

put/teams/{team_id}/members/{username}
 

Remove team member (Legacy)

DEPRECATED

The “Remove team member” endpoint (described below) is deprecated.

We recommend using the Remove team membership for a user endpoint instead. It allows you to remove both active and pending memberships.

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub’s products in the GitHub Help documentation.

To remove a team member, the authenticated user must have ‘admin’ permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.

Note: When you have team synchronization set up for a team with your organization’s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team’s membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see “Synchronizing teams between your identity provider and GitHub Enterprise Server.”

delete
{protocol}://{hostname}/api/v3/teams/{team_id}/members/{username}

Path Parameters

team_idintegerrequired
usernamestringrequired

Response

Response

delete/teams/{team_id}/members/{username}
 

Get team membership for a user (Legacy)

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

get
{protocol}://{hostname}/api/v3/teams/{team_id}/memberships/{username}

Path Parameters

team_idintegerrequired
usernamestringrequired

Response

application/json

Response

Team Membership

Team Membership

urlstring(uri)required
rolestringrequired

The role of the user in the team.

Allowed values:membermaintainer

Default:member

Example:member

statestringrequired

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

Allowed values:activepending

get/teams/{team_id}/memberships/{username}
 
application/json