Teams

Interact with GitHub Teams.

Operations

MethodEndpointDescription
GET/orgs/{org}/teamsList teams
POST/orgs/{org}/teamsCreate a team
GET/orgs/{org}/teams/{team_slug}Get a team by name
PATCH/orgs/{org}/teams/{team_slug}Update a team
DELETE/orgs/{org}/teams/{team_slug}Delete a team
GET/orgs/{org}/teams/{team_slug}/invitationsList pending team invitations
GET/orgs/{org}/teams/{team_slug}/membersList team members
GET/orgs/{org}/teams/{team_slug}/memberships/{username}Get team membership for a user
PUT/orgs/{org}/teams/{team_slug}/memberships/{username}Add or update team membership for a user
DELETE/orgs/{org}/teams/{team_slug}/memberships/{username}Remove team membership for a user
GET/orgs/{org}/teams/{team_slug}/reposList team repositories
GET/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}Check team permissions for a repository
PUT/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}Add or update team repository permissions
DELETE/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}Remove a repository from a team
GET/orgs/{org}/teams/{team_slug}/teamsList child teams
GET/teams/{team_id}Get a team (Legacy) (deprecated)
PATCH/teams/{team_id}Update a team (Legacy) (deprecated)
DELETE/teams/{team_id}Delete a team (Legacy) (deprecated)
GET/teams/{team_id}/invitationsList pending team invitations (Legacy) (deprecated)
GET/teams/{team_id}/membersList team members (Legacy) (deprecated)
GET/teams/{team_id}/members/{username}Get team member (Legacy) (deprecated)
PUT/teams/{team_id}/members/{username}Add team member (Legacy) (deprecated)
DELETE/teams/{team_id}/members/{username}Remove team member (Legacy) (deprecated)
GET/teams/{team_id}/memberships/{username}Get team membership for a user (Legacy) (deprecated)
PUT/teams/{team_id}/memberships/{username}Add or update team membership for a user (Legacy) (deprecated)
DELETE/teams/{team_id}/memberships/{username}Remove team membership for a user (Legacy) (deprecated)
GET/teams/{team_id}/reposList team repositories (Legacy) (deprecated)
GET/teams/{team_id}/repos/{owner}/{repo}Check team permissions for a repository (Legacy) (deprecated)
PUT/teams/{team_id}/repos/{owner}/{repo}Add or update team repository permissions (Legacy) (deprecated)
DELETE/teams/{team_id}/repos/{owner}/{repo}Remove a repository from a team (Legacy) (deprecated)
GET/teams/{team_id}/teamsList child teams (Legacy) (deprecated)
GET/user/teamsList teams for the authenticated user

Example

List teams, with the TypeScript SDK:

ts
import { GitHubV3REST } from "github";

const client = new GitHubV3REST({
  baseUrl: "https://api.github.com",
});

const result = await client.teams.list({
  org: "org",
});
console.log(result);
Nine more languages

The same call exists in every SDK. See SDKs for the other nine.