Update a team (Legacy)
Deprecated PATCH
/teams/{team_id} https://api.github.com
[!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
privacyfor parent teams cannot besecret.
Parameters
path Path Parameters
| Name | Type |
|---|---|
team_id
required
The unique identifier of the team. | number |
Request Body
application/json
required
{
name: string;
description?: string;
privacy?: "secret" | "closed";
notification_setting?: "notifications_enabled" | "notifications_disabled";
permission?: "pull" | "push" | "admin";
parent_team_id?: number | null;
}
name: string;
description?: string;
privacy?: "secret" | "closed";
notification_setting?: "notifications_enabled" | "notifications_disabled";
permission?: "pull" | "push" | "admin";
parent_team_id?: number | null;
}
Responses
200 application/json
Response when the updated information already exists
interface TeamFull {
id: number;
node_id: string;
url: string;
html_url: string;
name: string;
slug: string;
description: string | null;
privacy?: "closed" | "secret";
notification_setting?: "notifications_enabled" | "notifications_disabled";
permission: string;
members_url: string;
repositories_url: string;
parent?:TeamSimple | null;
members_count: number;
repos_count: number;
created_at: string;
updated_at: string;
organization:TeamOrganization ;
ldap_dn?:LdapDn ;
type: "enterprise" | "organization";
organization_id?: number;
enterprise_id?: number;
}
id: number;
node_id: string;
url: string;
html_url: string;
name: string;
slug: string;
description: string | null;
privacy?: "closed" | "secret";
notification_setting?: "notifications_enabled" | "notifications_disabled";
permission: string;
members_url: string;
repositories_url: string;
parent?:
members_count: number;
repos_count: number;
created_at: string;
updated_at: string;
organization:
ldap_dn?:
type: "enterprise" | "organization";
organization_id?: number;
enterprise_id?: number;
}
201 application/json
Response
interface TeamFull {
id: number;
node_id: string;
url: string;
html_url: string;
name: string;
slug: string;
description: string | null;
privacy?: "closed" | "secret";
notification_setting?: "notifications_enabled" | "notifications_disabled";
permission: string;
members_url: string;
repositories_url: string;
parent?:TeamSimple | null;
members_count: number;
repos_count: number;
created_at: string;
updated_at: string;
organization:TeamOrganization ;
ldap_dn?:LdapDn ;
type: "enterprise" | "organization";
organization_id?: number;
enterprise_id?: number;
}
id: number;
node_id: string;
url: string;
html_url: string;
name: string;
slug: string;
description: string | null;
privacy?: "closed" | "secret";
notification_setting?: "notifications_enabled" | "notifications_disabled";
permission: string;
members_url: string;
repositories_url: string;
parent?:
members_count: number;
repos_count: number;
created_at: string;
updated_at: string;
organization:
ldap_dn?:
type: "enterprise" | "organization";
organization_id?: number;
enterprise_id?: number;
}
Client Errors
403 application/json
Forbidden
interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
404 application/json
Resource not found
interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
422 application/json
Validation failed, or the endpoint has been spammed.
interface ValidationError {
message: string;
documentation_url: string;
errors?: {
resource?: string;
field?: string;
message?: string;
code: string;
index?: number;
value?: string[] | string | number | null;
}[];
}
message: string;
documentation_url: string;
errors?: {
resource?: string;
field?: string;
message?: string;
code: string;
index?: number;
value?: string[] | string | number | null;
}[];
}