REST API endpoints for enterprise team organizations
Use the REST API to create and manage organization assignments for enterprise teams in your GitHub enterprise.
About enterprise team organizations
참고 항목
이 엔드포인트는 현재 공개 미리 보기 버전이며 변경될 수 있습니다.
이 API 문서는 GitHub Enterprise Cloud의 엔터프라이즈용입니다.
엔터프라이즈가 GHE가 아닌 Copilot Business라면, 이전에 공유된 초기 액세스 문서 링크를 참조하세요.
이 엔드포인트는 클래식 personal access tokens을 사용하는 엔터프라이즈 팀의 엔터프라이즈에 인증된 구성원만 사용할 수 있으며, 필요한 권한은 read:enterprise scope(GET API용) 및 admin:enterprise(기타 API용)입니다.
이러한 엔드포인트는 fine-grained personal access tokens 또는 GitHub 앱 액세스 토큰과는 호환되지 않습니다.
GitHub는 팀 name에서 엔터프라이즈 팀의 slug를 생성하고 ent: 접두사를 추가합니다.
Get organization assignments
Get all organizations assigned to an enterprise team
"Get organization assignments"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Get organization assignments"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
enterprise-team string RequiredThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| 속성, 형식, 설명 |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." 기본값: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." 기본값: |
"Get organization assignments"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | An array of organizations the team is assigned to |
"Get organization assignments"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizationsAn array of organizations the team is assigned to
Status: 200{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}Add organization assignments
Assign an enterprise team to multiple organizations.
"Add organization assignments"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Add organization assignments"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
enterprise-team string RequiredThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| 속성, 형식, 설명 |
|---|
organization_slugs array of strings RequiredOrganization slug to assign the team to. |
"Add organization assignments"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | Successfully assigned the enterprise team to organizations. |
"Add organization assignments"에 대한 코드 샘플
요청 예제
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/add \
-d '{"organization_slugs":["github"]}'Successfully assigned the enterprise team to organizations.
Status: 200[
{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}
]Remove organization assignments
Unassign an enterprise team from multiple organizations.
"Remove organization assignments"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Remove organization assignments"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
enterprise-team string RequiredThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
| 속성, 형식, 설명 |
|---|
organization_slugs array of strings RequiredOrganization slug to unassign the team from. |
"Remove organization assignments"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
204 | Successfully unassigned the enterprise team from organizations. |
"Remove organization assignments"에 대한 코드 샘플
요청 예제
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/remove \
-d '{"organization_slugs":["github"]}'Successfully unassigned the enterprise team from organizations.
Status: 204Get organization assignment
Check if an enterprise team is assigned to an organization
"Get organization assignment"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Get organization assignment"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
enterprise-team string RequiredThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string RequiredThe organization name. The name is not case sensitive. |
"Get organization assignment"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | The team is assigned to the organization |
404 | The team is not assigned to the organization |
"Get organization assignment"에 대한 코드 샘플
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/ORGThe team is assigned to the organization
Status: 200{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}Add an organization assignment
Assign an enterprise team to an organization.
"Add an organization assignment"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Add an organization assignment"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
enterprise-team string RequiredThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string RequiredThe organization name. The name is not case sensitive. |
"Add an organization assignment"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
201 | Successfully assigned the enterprise team to the organization. |
"Add an organization assignment"에 대한 코드 샘플
요청 예제
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/ORGSuccessfully assigned the enterprise team to the organization.
Status: 201{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}Delete an organization assignment
Unassign an enterprise team from an organization.
"Delete an organization assignment"에 대한 세분화된 액세스 토큰
이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.
"Delete an organization assignment"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
enterprise-team string RequiredThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org string RequiredThe organization name. The name is not case sensitive. |
"Delete an organization assignment"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
204 | Successfully unassigned the enterprise team from the organization. |
"Delete an organization assignment"에 대한 코드 샘플
요청 예제
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/ORGSuccessfully unassigned the enterprise team from the organization.
Status: 204