Search + K

Command Palette

Search for a command to run...

Sign In

Create a team

POST /orgs/{org}/teams
Copy endpoint
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;
}

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

Groups of organization members that gives permissions on specified repositories.

interface TeamSimple {
id: number;
node_id: string;
url: string;
members_url: string;
name: string;
description: string | null;
permission: string;
privacy?: string;
notification_setting?: string;
html_url: string;
repositories_url: string;
slug: string;
ldap_dn?: string;
type: "enterprise" | "organization";
organization_id?: number;
enterprise_id?: number;
}
| null
;
members_count: number;
repos_count: number;
created_at: string;
updated_at: string;
organization: TeamOrganization

Team Organization

interface TeamOrganization {
login: string;
id: number;
node_id: string;
url: string;
repos_url: string;
events_url: string;
hooks_url: string;
issues_url: string;
members_url: string;
public_members_url: string;
avatar_url: string;
description: string | null;
name?: string;
company?: string;
blog?: string;
location?: string;
email?: string;
twitter_username?: string | null;
is_verified?: boolean;
has_organization_projects: boolean;
has_repository_projects: boolean;
public_repos: number;
public_gists: number;
followers: number;
following: number;
html_url: string;
created_at: string;
type: string;
total_private_repos?: number;
owned_private_repos?: number;
private_gists?: number | null;
disk_usage?: number | null;
collaborators?: number | null;
billing_email?: string | null;
plan?: {
name: string;
space: number;
private_repos: number;
filled_seats?: number;
seats?: number;
}
;
default_repository_permission?: string | null;
members_can_create_repositories?: boolean | null;
two_factor_requirement_enabled?: boolean | null;
members_allowed_repository_creation_type?: string;
members_can_create_public_repositories?: boolean;
members_can_create_private_repositories?: boolean;
members_can_create_internal_repositories?: boolean;
members_can_create_pages?: boolean;
members_can_create_public_pages?: boolean;
members_can_create_private_pages?: boolean;
members_can_fork_private_repositories?: boolean | null;
web_commit_signoff_required?: boolean;
updated_at: string;
archived_at: string | null;
}
;
ldap_dn?: LdapDn

The distinguished name (DN) of the LDAP entry to map to a team.

type LdapDn = string
;
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;
}
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;
}
[]
;
}