Use the REST API to create and manage teams in your GitHub organization.
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.
GET /orgs/{org}/teams
Lists all teams in an organization that are visible to the authenticated user.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
team_type (string)
Filter team results by their type. For more information, see "What kind of team should I use?"
Default: all
Can be one of: all, enterprise, organization
200 - OK
403 - Forbidden
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/teams
Response schema (Status: 200):
Array of Team:
id: required, integernode_id: required, stringname: required, stringslug: required, stringdescription: required, string or nullprivacy: stringnotification_setting: stringpermission: required, stringpermissions: object:
pull: required, booleantriage: required, booleanpush: required, booleanmaintain: required, booleanadmin: required, booleanurl: required, string, format: urihtml_url: required, string, format: urimembers_url: required, stringrepositories_url: required, string, format: uritype: required, string, enum: enterprise, organizationaccess_source: string, enum: direct, organization, enterpriseorganization_id: integerenterprise_id: integerparent: required, any of:
id: required, integernode_id: required, stringurl: required, string, format: urimembers_url: required, stringname: required, stringdescription: required, string or nullpermission: required, stringprivacy: stringnotification_setting: stringhtml_url: required, string, format: urirepositories_url: required, string, format: urislug: required, stringldap_dn: stringtype: required, string, enum: enterprise, organizationorganization_id: integerenterprise_id: integerPOST /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".
accept (string)application/vnd.github+json is recommended.org (string) (required)name (string) (required)
The name of the team.
description (string)
The description of the team.
maintainers (array of strings)
List GitHub usernames for organization members who will become team maintainers.
repo_names (array of strings)
The full name (e.g., "organization-name/repository-name") of repositories to add the team to.
privacy (string)
The level of privacy this team should have. The options are:
For a non-nested team:
secret - only visible to organization owners and members of this team.
closed - visible to all members of this organization.
Default: secret
For a parent or child team:
closed - visible to all members of this organization.
Default for child team: closed
Can be one of: secret, closed
notification_setting (string)
The notification setting the team has chosen. The options are:
notifications_enabled - team members receive notifications when the team is @mentioned.
notifications_disabled - no one receives notifications.
Default: notifications_enabled
Can be one of: notifications_enabled, notifications_disabled
parent_team_id (integer)
The ID of a team to set as the parent team.
parent_team_slug (string)
The slug of a team to set as the parent team. Ignored when parent_team_id is also provided.
201 - Created
403 - Forbidden
422 - Validation failed, or the endpoint has been spammed.
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):
id: required, integernode_id: required, stringurl: required, string, format: urihtml_url: required, string, format: uriname: required, stringslug: required, stringdescription: required, string or nullprivacy: string, enum: closed, secretnotification_setting: string, enum: notifications_enabled, notifications_disabledpermission: required, stringmembers_url: required, stringrepositories_url: required, string, format: uriparent: any of:
id: required, integernode_id: required, stringurl: required, string, format: urimembers_url: required, stringname: required, stringdescription: required, string or nullpermission: required, stringprivacy: stringnotification_setting: stringhtml_url: required, string, format: urirepositories_url: required, string, format: urislug: required, stringldap_dn: stringtype: required, string, enum: enterprise, organizationorganization_id: integerenterprise_id: integermembers_count: required, integerrepos_count: required, integercreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeorganization: required, Team Organization:
login: required, stringid: required, integernode_id: required, stringurl: required, string, format: urirepos_url: required, string, format: urievents_url: required, string, format: urihooks_url: required, stringissues_url: required, stringmembers_url: required, stringpublic_members_url: required, stringavatar_url: required, stringdescription: required, string or nullname: stringcompany: string or nullblog: string or null, format: urilocation: string or nullemail: string or null, format: emailtwitter_username: string or nullis_verified: booleanhas_organization_projects: required, booleanhas_repository_projects: required, booleanpublic_repos: required, integerpublic_gists: required, integerfollowers: required, integerfollowing: required, integerhtml_url: required, string, format: uricreated_at: required, string, format: date-timetype: required, stringtotal_private_repos: integerowned_private_repos: integerprivate_gists: integer or nulldisk_usage: integer or nullcollaborators: integer or nullbilling_email: string or null, format: emailplan: object:
name: required, stringspace: required, integerprivate_repos: required, integerfilled_seats: integerseats: integerdefault_repository_permission: string or nullmembers_can_create_repositories: boolean or nulltwo_factor_requirement_enabled: boolean or nullmembers_allowed_repository_creation_type: stringmembers_can_create_public_repositories: booleanmembers_can_create_private_repositories: booleanmembers_can_create_internal_repositories: booleanmembers_can_create_pages: booleanmembers_can_create_public_pages: booleanmembers_can_create_private_pages: booleanmembers_can_fork_private_repositories: boolean or nullweb_commit_signoff_required: booleanupdated_at: required, string, format: date-timearchived_at: required, string or null, format: date-timeldap_dn: stringtype: required, string, enum: enterprise, organizationorganization_id: integerenterprise_id: integerGET /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}.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
200 - OK
404 - Resource not found
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.
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}.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
name (string)
The name of the team.
description (string)
The description of the team.
privacy (string)
The level of privacy this team should have. Editing teams without specifying this parameter leaves privacy intact. When a team is nested, the privacy for parent teams cannot be secret. The options are:
For a non-nested team:
secret - only visible to organization owners and members of this team.
closed - visible to all members of this organization.
For a parent or child team:
closed - visible to all members of this organization.
Can be one of: secret, closed
notification_setting (string)
The notification setting the team has chosen. Editing teams without specifying this parameter leaves notification_setting intact. The options are:
notifications_enabled - team members receive notifications when the team is @mentioned.
notifications_disabled - no one receives notifications.
Can be one of: notifications_enabled, notifications_disabled
permission (string)
Closing down notice. The permission that new repositories will be added to the team with when none is specified.
Default: pull
Can be one of: pull, push, admin
parent_team_id (integer or null)
The ID of a team to set as the parent team.
parent_team_slug (string or null)
The slug of a team to set as the parent team. Ignored when parent_team_id is also provided.
200 - Response when the updated information already exists
201 - Created
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
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.
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 /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}.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
204 - No Content
422 - Unprocessable entity if you attempt to modify an enterprise team at the organization level.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG
Response schema (Status: 204):
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos
Response schema (Status: 200):
Array of Minimal Repository:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, booleanhtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: stringmirror_url: string or nullhooks_url: required, string, format: urisvn_url: stringhomepage: string or nulllanguage: string or nullforks_count: integerstargazers_count: integerwatchers_count: integersize: integerdefault_branch: stringopen_issues_count: integeris_template: booleantopics: array of stringhas_issues: booleanhas_projects: booleanhas_wiki: booleanhas_pages: booleanhas_discussions: booleanhas_pull_requests: booleanpull_request_creation_policy: string, enum: all, collaborators_onlyarchived: booleandisabled: booleanvisibility: stringpushed_at: string or null, format: date-timecreated_at: string or null, format: date-timeupdated_at: string or null, format: date-timepermissions: object:
admin: booleanmaintain: booleanpush: booleantriage: booleanpull: booleanrole_name: stringtemp_clone_token: stringdelete_branch_on_merge: booleansubscribers_count: integernetwork_count: integercode_of_conduct: Code Of Conduct:
key: required, stringname: required, stringurl: required, string, format: uribody: stringhtml_url: required, string or null, format: urilicense: object or null:
key: stringname: stringspdx_id: stringurl: string or nullnode_id: stringforks: integeropen_issues: integerwatchers: integerallow_forking: booleanweb_commit_signoff_required: booleansecurity_and_analysis: object or null:
advanced_security: object:
status: string, enum: enabled, disabledcode_security: object:
status: string, enum: enabled, disableddependabot_security_updates: object:
status: string, enum: enabled, disabledsecret_scanning: object:
status: string, enum: enabled, disabledsecret_scanning_push_protection: object:
status: string, enum: enabled, disabledsecret_scanning_non_provider_patterns: object:
status: string, enum: enabled, disabledsecret_scanning_ai_detection: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_alert_dismissal: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass_options: object:
reviewers: array of objects:
reviewer_id: required, integerreviewer_type: required, string, enum: TEAM, ROLEmode: string, enum: ALWAYS, EXEMPT, default: "ALWAYS"custom_properties: object, additional properties allowedGET /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}.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
200 - Alternative response with repository permissions
204 - Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header.
404 - Not Found if team does not have permission for the repository
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO
Response schema (Status: 200):
id: required, integernode_id: required, stringname: required, stringfull_name: required, stringlicense: required, any of:
key: required, stringname: required, stringurl: required, string or null, format: urispdx_id: required, string or nullnode_id: required, stringhtml_url: string, format: uriforks: required, integerpermissions: object:
admin: required, booleanpull: required, booleantriage: booleanpush: required, booleanmaintain: booleanrole_name: stringowner: required, any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, boolean, default: falsehtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: required, stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: required, stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: required, stringmirror_url: required, string or null, format: urihooks_url: required, string, format: urisvn_url: required, string, format: urihomepage: required, string or null, format: urilanguage: required, string or nullforks_count: required, integerstargazers_count: required, integerwatchers_count: required, integersize: required, integerdefault_branch: required, stringopen_issues_count: required, integeris_template: boolean, default: falsetopics: array of stringhas_issues: required, boolean, default: truehas_projects: required, boolean, default: truehas_wiki: required, boolean, default: truehas_pages: required, booleanarchived: required, boolean, default: falsedisabled: required, booleanvisibility: string, default: "public"pushed_at: required, string or null, format: date-timecreated_at: required, string or null, format: date-timeupdated_at: required, string or null, format: date-timeallow_rebase_merge: boolean, default: truetemp_clone_token: stringallow_squash_merge: boolean, default: trueallow_auto_merge: boolean, default: falsedelete_branch_on_merge: boolean, default: falseallow_merge_commit: boolean, default: trueallow_forking: boolean, default: falseweb_commit_signoff_required: boolean, default: falsesubscribers_count: integernetwork_count: integeropen_issues: required, integerwatchers: required, integermaster_branch: stringPUT /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".
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
permission (string)Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO \
-d '{
"permission": "push"
}'
Response schema (Status: 204):
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}.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/teams/TEAM_SLUG/repos/OWNER/REPO
Response schema (Status: 204):
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
team_slug (string) (required)
The slug of the team name.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
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 /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.
accept (string)application/vnd.github+json is recommended.team_id (integer) (required)200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/teams/TEAM_ID
Response schema (Status: 200):
Same response schema as Create a team.
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.
accept (string)application/vnd.github+json is recommended.team_id (integer) (required)name (string) (required)
The name of the team.
description (string)
The description of the team.
privacy (string)
The level of privacy this team should have. Editing teams without specifying this parameter leaves privacy intact. The options are:
For a non-nested team:
secret - only visible to organization owners and members of this team.
closed - visible to all members of this organization.
For a parent or child team:
closed - visible to all members of this organization.
Can be one of: secret, closed
notification_setting (string)
The notification setting the team has chosen. Editing teams without specifying this parameter leaves notification_setting intact. The options are:
notifications_enabled - team members receive notifications when the team is @mentioned.
notifications_disabled - no one receives notifications.
Can be one of: notifications_enabled, notifications_disabled
permission (string)
Closing down notice. The permission that new repositories will be added to the team with when none is specified.
Default: pull
Can be one of: pull, push, admin
parent_team_id (integer or null)
The ID of a team to set as the parent team.
parent_team_slug (string or null)
The slug of a team to set as the parent team. Ignored when parent_team_id is also provided.
200 - Response when the updated information already exists
201 - Created
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
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.
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 /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.
accept (string)application/vnd.github+json is recommended.team_id (integer) (required)204 - No Content
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X DELETE \
https://api.github.com/teams/TEAM_ID
Response schema (Status: 204):
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.
accept (string)application/vnd.github+json is recommended.team_id (integer) (required)
The unique identifier of the team.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/teams/TEAM_ID/repos
Response schema (Status: 200):
Same response schema as List team repositories.
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:
accept (string)application/vnd.github+json is recommended.team_id (integer) (required)
The unique identifier of the team.
owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
200 - Alternative response with extra repository information
204 - Response if repository is managed by this team
404 - Not Found if repository is not managed by this team
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.
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."
accept (string)application/vnd.github+json is recommended.team_id (integer) (required)
The unique identifier of the team.
owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
permission (string)pull, push, admin204 - No Content
403 - Forbidden
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X PUT \
https://api.github.com/teams/TEAM_ID/repos/OWNER/REPO \
-d '{
"permission": "push"
}'
Response schema (Status: 204):
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.
accept (string)application/vnd.github+json is recommended.team_id (integer) (required)
The unique identifier of the team.
owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
Request:
curl -L \
-X DELETE \
https://api.github.com/teams/TEAM_ID/repos/OWNER/REPO
Response schema (Status: 204):
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.
accept (string)application/vnd.github+json is recommended.team_id (integer) (required)
The unique identifier of the team.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - if child teams exist
403 - Forbidden
404 - Resource not found
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X GET \
https://api.github.com/teams/TEAM_ID/teams
Response schema (Status: 200):
Same response schema as List teams.
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.
accept (string)application/vnd.github+json is recommended.per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
304 - Not modified
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/user/teams
Response schema (Status: 200):
Array of Full Team:
id: required, integernode_id: required, stringurl: required, string, format: urihtml_url: required, string, format: uriname: required, stringslug: required, stringdescription: required, string or nullprivacy: string, enum: closed, secretnotification_setting: string, enum: notifications_enabled, notifications_disabledpermission: required, stringmembers_url: required, stringrepositories_url: required, string, format: uriparent: any of:
id: required, integernode_id: required, stringurl: required, string, format: urimembers_url: required, stringname: required, stringdescription: required, string or nullpermission: required, stringprivacy: stringnotification_setting: stringhtml_url: required, string, format: urirepositories_url: required, string, format: urislug: required, stringldap_dn: stringtype: required, string, enum: enterprise, organizationorganization_id: integerenterprise_id: integermembers_count: required, integerrepos_count: required, integercreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeorganization: required, Team Organization:
login: required, stringid: required, integernode_id: required, stringurl: required, string, format: urirepos_url: required, string, format: urievents_url: required, string, format: urihooks_url: required, stringissues_url: required, stringmembers_url: required, stringpublic_members_url: required, stringavatar_url: required, stringdescription: required, string or nullname: stringcompany: string or nullblog: string or null, format: urilocation: string or nullemail: string or null, format: emailtwitter_username: string or nullis_verified: booleanhas_organization_projects: required, booleanhas_repository_projects: required, booleanpublic_repos: required, integerpublic_gists: required, integerfollowers: required, integerfollowing: required, integerhtml_url: required, string, format: uricreated_at: required, string, format: date-timetype: required, stringtotal_private_repos: integerowned_private_repos: integerprivate_gists: integer or nulldisk_usage: integer or nullcollaborators: integer or nullbilling_email: string or null, format: emailplan: object:
name: required, stringspace: required, integerprivate_repos: required, integerfilled_seats: integerseats: integerdefault_repository_permission: string or nullmembers_can_create_repositories: boolean or nulltwo_factor_requirement_enabled: boolean or nullmembers_allowed_repository_creation_type: stringmembers_can_create_public_repositories: booleanmembers_can_create_private_repositories: booleanmembers_can_create_internal_repositories: booleanmembers_can_create_pages: booleanmembers_can_create_public_pages: booleanmembers_can_create_private_pages: booleanmembers_can_fork_private_repositories: boolean or nullweb_commit_signoff_required: booleanupdated_at: required, string, format: date-timearchived_at: required, string or null, format: date-timeldap_dn: stringtype: required, string, enum: enterprise, organizationorganization_id: integerenterprise_id: integer