REST API endpoints for teams

Use the REST API to create and manage teams in your GitHub organization.

About teams

These endpoints are only available to authenticated members of the team's organization. OAuth access tokens require the read:org scope. GitHub generates the team's slug from the team name.

Where pull and push permissions are accepted, these will map to the Read and Write roles for an organization repository. For more information about repository roles, see Repository roles for an organization.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List teams

GET /orgs/{org}/teams

Lists all teams in an organization that are visible to the authenticated user.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/teams

Response schema (Status: 200):

Array of Team:

Create a team

POST /orgs/{org}/teams

To create a team, the authenticated user must be a member or owner of {org}. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "Setting team creation permissions."
When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of maintainers. For more information, see "About teams".

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/orgs/ORG/teams \
  -d '{
  "name": "Justice League",
  "description": "A great team",
  "permission": "push",
  "notification_setting": "notifications_enabled",
  "privacy": "closed"
}'

Response schema (Status: 201):

Get a team by name

GET /orgs/{org}/teams/{team_slug}

Gets a team using the team's slug. To create the slug, GitHub replaces special characters in the name string, changes all words to lowercase, and replaces spaces with a - separator. For example, "My TEam Näme" would become my-team-name.
Note

You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG

Response schema (Status: 200):

Same response schema as Create a team.

Update a team

PATCH /orgs/{org}/teams/{team_slug}

To edit a team, the authenticated user must either be an organization owner or a team maintainer.
Note

You can also specify a team by org_id and team_id using the route PATCH /organizations/{org_id}/team/{team_id}.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X PATCH \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG \
  -d '{
  "name": "new team name",
  "description": "new team description",
  "privacy": "closed",
  "notification_setting": "notifications_enabled"
}'

Response schema (Status: 200):

Same response schema as Create a team.

Example 2: Status Code 201

Request:

curl -L \
  -X PATCH \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG \
  -d '{
  "name": "new team name",
  "description": "new team description",
  "privacy": "closed",
  "notification_setting": "notifications_enabled"
}'

Response schema (Status: 201):

Same response schema as Create a team.

Delete a team

DELETE /orgs/{org}/teams/{team_slug}

To delete a team, the authenticated user must be an organization owner or team maintainer.
If you are an organization owner, deleting a parent team will delete all of its child teams as well.
Note

You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG

Response schema (Status: 204):

List team repositories

GET /orgs/{org}/teams/{team_slug}/repos

Lists a team's repositories visible to the authenticated user.
OAuth app tokens and personal access tokens (classic) need the read:org or repo scope to use this endpoint.
Note

You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/repos.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos

Response schema (Status: 200):

Array of Minimal Repository:

Check team permissions for a repository

GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}

Checks whether a team has admin, push, maintain, triage, or pull permission for a repository. Repositories inherited through a parent team will also be checked.
You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the application/vnd.github.v3.repository+json accept header.
If a team doesn't have permission for the repository, you will receive a 404 Not Found response status.
If the repository is private, you must have at least read permission for that repository, and your token must have the repo or admin:org scope. Otherwise, you will receive a 404 Not Found response status.
Note

You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO

Response schema (Status: 200):

Add or update team repository permissions

PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}

To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP method."
Note

You can also specify a team by org_id and team_id using the route PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.

For more information about the permission levels, see "Repository permission levels for an organization".

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Adding a team to an organization repository with the write role

Request:

curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO \
  -d '{
  "permission": "push"
}'

Response schema (Status: 204):

Remove a repository from a team

DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}

If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.
Note

You can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO

Response schema (Status: 204):

List child teams

GET /orgs/{org}/teams/{team_slug}/teams

Lists the child teams of the team specified by {team_slug}.
Note

You can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/teams.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/teams

Response schema (Status: 200):

Same response schema as List teams.

Get a team (Legacy)

GET /teams/{team_id}

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 Get a team by name endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/teams/TEAM_ID

Response schema (Status: 200):

Same response schema as Create a team.

Update a team (Legacy)

PATCH /teams/{team_id}

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 Update a team endpoint.

To edit a team, the authenticated user must either be an organization owner or a team maintainer.
Note

With nested teams, the privacy for parent teams cannot be secret.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X PATCH \
  https://api.github.com/teams/TEAM_ID \
  -d '{
  "name": "new team name",
  "description": "new team description",
  "privacy": "closed",
  "notification_setting": "notifications_enabled"
}'

Response schema (Status: 200):

Same response schema as Create a team.

Example 2: Status Code 201

Request:

curl -L \
  -X PATCH \
  https://api.github.com/teams/TEAM_ID \
  -d '{
  "name": "new team name",
  "description": "new team description",
  "privacy": "closed",
  "notification_setting": "notifications_enabled"
}'

Response schema (Status: 201):

Same response schema as Create a team.

Delete a team (Legacy)

DELETE /teams/{team_id}

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 Delete a team endpoint.

To delete a team, the authenticated user must be an organization owner or team maintainer.
If you are an organization owner, deleting a parent team will delete all of its child teams as well.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/teams/TEAM_ID

Response schema (Status: 204):

List team repositories (Legacy)

GET /teams/{team_id}/repos

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

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/teams/TEAM_ID/repos

Response schema (Status: 200):

Same response schema as List team repositories.

Check team permissions for a repository (Legacy)

GET /teams/{team_id}/repos/{owner}/{repo}

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 Check team permissions for a repository endpoint.

Note

Repositories inherited through a parent team will also be checked.

You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom media type via the Accept header:

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/teams/TEAM_ID/repos/OWNER/REPO

Response schema (Status: 200):

Same response schema as Check team permissions for a repository.

Add or update team repository permissions (Legacy)

PUT /teams/{team_id}/repos/{owner}/{repo}

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 "Add or update team repository permissions" endpoint.

To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity status if you attempt to add a repository to a team that is not owned by the organization.
Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP method."

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example of setting permission to pull

Request:

curl -L \
  -X PUT \
  https://api.github.com/teams/TEAM_ID/repos/OWNER/REPO \
  -d '{
  "permission": "push"
}'

Response schema (Status: 204):

Remove a repository from a team (Legacy)

DELETE /teams/{team_id}/repos/{owner}/{repo}

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 Remove a repository from a team endpoint.

If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/teams/TEAM_ID/repos/OWNER/REPO

Response schema (Status: 204):

List child teams (Legacy)

GET /teams/{team_id}/teams

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 List child teams endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/teams/TEAM_ID/teams

Response schema (Status: 200):

Same response schema as List teams.

List teams for the authenticated user

GET /user/teams

List all of the teams across all of the organizations to which the authenticated
user belongs.
OAuth app tokens and personal access tokens (classic) need the user, repo, or read:org scope to use this endpoint.
When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/teams

Response schema (Status: 200):

Array of Full Team: