Diese Version von GitHub Enterprise Server wurde eingestellt am 2024-03-26. Es wird keine Patch-Freigabe vorgenommen, auch nicht für kritische Sicherheitsprobleme. Für bessere Leistung, verbesserte Sicherheit und neue Features aktualisiere auf die neueste Version von GitHub Enterprise Server. Wende dich an den GitHub Enterprise-Support, um Hilfe zum Upgrade zu erhalten.
REST-API-Endpunkte für Unternehmensorganisationen
Verwende die REST-API zum Erstellen von Organisationen in deinem Unternehmen.
Informationen zur Organisationsverwaltung
Diese Endpunkte sind nur für authentifizierte Websiteadministratoren verfügbar. Normale Benutzer erhalten eine 404-Antwort.
Create an organization
Parameter für „Create an organization“
| Name, type, BESCHREIBUNG | 
|---|
accept string Setting to   | 
| Name, type, BESCHREIBUNG | 
|---|
login string ErforderlichThe organization's username.  | 
admin string ErforderlichThe login of the user who will manage this organization.  | 
profile_name string The organization's display name.  | 
HTTP-Antwortstatuscodes für „Create an organization“
| Statuscode | BESCHREIBUNG | 
|---|---|
201 | Created  | 
Codebeispiele für „Create an organization“
Beispiel für eine Anfrage
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/admin/organizations \
  -d '{"login":"github","profile_name":"GitHub, Inc.","admin":"monalisaoctocat"}'Response
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"
}Update an organization name
Parameter für „Update an organization name“
| Name, type, BESCHREIBUNG | 
|---|
accept string Setting to   | 
| Name, type, BESCHREIBUNG | 
|---|
org string ErforderlichThe organization name. The name is not case sensitive.  | 
| Name, type, BESCHREIBUNG | 
|---|
login string ErforderlichThe organization's new name.  | 
HTTP-Antwortstatuscodes für „Update an organization name“
| Statuscode | BESCHREIBUNG | 
|---|---|
202 | Accepted  | 
Codebeispiele für „Update an organization name“
Beispiel für eine Anfrage
curl -L \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/admin/organizations/ORG \
  -d '{"login":"the-new-octocats"}'Response
Status: 202{
  "message": "Job queued to rename organization. It may take a few minutes to complete.",
  "url": "https://<hostname>/api/v3/organizations/1"
}