Skip to main content

Enterprise Server 3.21 ist derzeit als Release Candidate verfügbar.

Die REST-API ist jetzt versioniert. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.

REST-API-Endpunkte für Unternehmensteamorganisationen

Verwenden Sie die REST-API, um Organisationszuweisungen für Unternehmensteams in Ihren GitHub Enterprise zu erstellen und zu verwalten.

Informationen zu Unternehmensteamorganisationen

Hinweis

Diese Endpunkte befinden sich derzeit in Öffentliche Vorschau. Änderungen sind vorbehalten.

Diese API-Dokumentation ist für Unternehmen mit GitHub Enterprise Cloud bestimmt.

Wenn dein Unternehmen Copilot Business für Nicht-GHE nutzt, lies den Link zur Early-Access-Dokumentation, der zuvor geteilt wurde.

Diese Endpunkte sind lediglich für authentifizierte Mitglieder des Unternehmens im Unternehmensteams mit klassischen personal access tokens mit dem read:enterprise-Bereich für GET-APIs und admin:enterprise für weitere APIs verfügbar.

Diese Endpunkte sind nicht mit fine-grained personal access tokens oder GitHub-App-Zugriffstoken kompatibel.

GitHub generiert das slug-Element des Unternehmensteams aus dem Team name und fügt das Präfix ent: hinzu.

Get organization assignments

Get all organizations assigned to an enterprise team

Fine-grained access tokens for "Get organization assignments"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (read)

Parameter für "Get organization assignments"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name.

enterprise-team string Erforderlich

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

Abfrageparameter
Name, Typ, BESCHREIBUNG
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Standard: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

Standard: 1

HTTP response status codes for "Get organization assignments"

Status codeBESCHREIBUNG
200

An array of organizations the team is assigned to

Code samples for "Get organization assignments"

Request example

get/enterprises/{enterprise}/teams/{enterprise-team}/organizations
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations

An array of organizations the team is assigned to

Status: 200
{ "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://HOSTNAME/orgs/github", "repos_url": "https://HOSTNAME/orgs/github/repos", "events_url": "https://HOSTNAME/orgs/github/events", "hooks_url": "https://HOSTNAME/orgs/github/hooks", "issues_url": "https://HOSTNAME/orgs/github/issues", "members_url": "https://HOSTNAME/orgs/github/members{/member}", "public_members_url": "https://HOSTNAME/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.

Fine-grained access tokens for "Add organization assignments"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (write)

Parameter für "Add organization assignments"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name.

enterprise-team string Erforderlich

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

Körperparameter
Name, Typ, BESCHREIBUNG
organization_slugs array of strings Erforderlich

Organization slug to assign the team to.

HTTP response status codes for "Add organization assignments"

Status codeBESCHREIBUNG
200

Successfully assigned the enterprise team to organizations.

Code samples for "Add organization assignments"

Request example

post/enterprises/{enterprise}/teams/{enterprise-team}/organizations/add
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/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://HOSTNAME/orgs/github", "repos_url": "https://HOSTNAME/orgs/github/repos", "events_url": "https://HOSTNAME/orgs/github/events", "hooks_url": "https://HOSTNAME/orgs/github/hooks", "issues_url": "https://HOSTNAME/orgs/github/issues", "members_url": "https://HOSTNAME/orgs/github/members{/member}", "public_members_url": "https://HOSTNAME/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.

Fine-grained access tokens for "Remove organization assignments"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (write)

Parameter für "Remove organization assignments"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name.

enterprise-team string Erforderlich

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

Körperparameter
Name, Typ, BESCHREIBUNG
organization_slugs array of strings Erforderlich

Organization slug to unassign the team from.

HTTP response status codes for "Remove organization assignments"

Status codeBESCHREIBUNG
204

Successfully unassigned the enterprise team from organizations.

Code samples for "Remove organization assignments"

Request example

post/enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/remove \ -d '{"organization_slugs":["github"]}'

Successfully unassigned the enterprise team from organizations.

Status: 204

Get organization assignment

Check if an enterprise team is assigned to an organization

Fine-grained access tokens for "Get organization assignment"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (read)

Parameter für "Get organization assignment"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name.

enterprise-team string Erforderlich

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

org string Erforderlich

The organization name. The name is not case sensitive.

HTTP response status codes for "Get organization assignment"

Status codeBESCHREIBUNG
200

The team is assigned to the organization

404

The team is not assigned to the organization

Code samples for "Get organization assignment"

Request example

get/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/ORG

The team is assigned to the organization

Status: 200
{ "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://HOSTNAME/orgs/github", "repos_url": "https://HOSTNAME/orgs/github/repos", "events_url": "https://HOSTNAME/orgs/github/events", "hooks_url": "https://HOSTNAME/orgs/github/hooks", "issues_url": "https://HOSTNAME/orgs/github/issues", "members_url": "https://HOSTNAME/orgs/github/members{/member}", "public_members_url": "https://HOSTNAME/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.

Fine-grained access tokens for "Add an organization assignment"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (write)

Parameter für "Add an organization assignment"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name.

enterprise-team string Erforderlich

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

org string Erforderlich

The organization name. The name is not case sensitive.

HTTP response status codes for "Add an organization assignment"

Status codeBESCHREIBUNG
201

Successfully assigned the enterprise team to the organization.

Code samples for "Add an organization assignment"

Request example

put/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/ORG

Successfully assigned the enterprise team to the organization.

Status: 201
{ "login": "github", "id": 1, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://HOSTNAME/orgs/github", "repos_url": "https://HOSTNAME/orgs/github/repos", "events_url": "https://HOSTNAME/orgs/github/events", "hooks_url": "https://HOSTNAME/orgs/github/hooks", "issues_url": "https://HOSTNAME/orgs/github/issues", "members_url": "https://HOSTNAME/orgs/github/members{/member}", "public_members_url": "https://HOSTNAME/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.

Fine-grained access tokens for "Delete an organization assignment"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Enterprise teams" enterprise permissions (write)

Parameter für "Delete an organization assignment"

Header
Name, Typ, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, Typ, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name.

enterprise-team string Erforderlich

The slug version of the enterprise team name. You can also substitute this value with the enterprise team id.

org string Erforderlich

The organization name. The name is not case sensitive.

HTTP response status codes for "Delete an organization assignment"

Status codeBESCHREIBUNG
204

Successfully unassigned the enterprise team from the organization.

Code samples for "Delete an organization assignment"

Request example

delete/enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/teams/ENTERPRISE-TEAM/organizations/ORG

Successfully unassigned the enterprise team from the organization.

Status: 204