Create a team
POST
/orgs/{org}/teams https://api.github.com
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
path Path Parameters
| Name | Type |
|---|---|
org
required
The organization name. The name is not case sensitive. | string |
Request Body
application/json
required
{
name: string;
description?: string;
maintainers?: string[];
repo_names?: string[];
privacy?: "secret" | "closed";
notification_setting?: "notifications_enabled" | "notifications_disabled";
permission?: "pull" | "push";
parent_team_id?: number;
}
name: string;
description?: string;
maintainers?: string[];
repo_names?: string[];
privacy?: "secret" | "closed";
notification_setting?: "notifications_enabled" | "notifications_disabled";
permission?: "pull" | "push";
parent_team_id?: number;
}
Responses
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;
}
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;
}[];
}