Esta versão do GitHub Enterprise foi descontinuada em 2022-06-03. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, melhorar a segurança e novos recursos, upgrade to the latest version of GitHub Enterprise. Para ajuda com a atualização, contact GitHub Enterprise support.
We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the Actions REST API page.
Organizações
A API de administração da organização permite a criação de organizações na sua empresa.
Só está disponível para administradores do site autenticados. Usuários normais receberão uma mensagem 404 se tentarem acessá-la.
Create an organization
Parâmetros
| Headers | 
|---|
| Nome, Tipo, Descrição | 
| acceptstringSetting to  | 
| Body parameters | 
| Nome, Tipo, Descrição | 
| loginstringObrigatórioThe organization's username. | 
| adminstringObrigatórioThe login of the user who will manage this organization. | 
| profile_namestringThe organization's display name. | 
HTTP response status codes
| Status code | Descrição | 
|---|---|
| 201 | Created | 
Amostras de código
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <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://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"
}Update an organization name
Parâmetros
| Headers | 
|---|
| Nome, Tipo, Descrição | 
| acceptstringSetting to  | 
| Path parameters | 
| Nome, Tipo, Descrição | 
| orgstringObrigatórioThe organization name. The name is not case sensitive. | 
| Body parameters | 
| Nome, Tipo, Descrição | 
| loginstringObrigatórioThe organization's new name. | 
HTTP response status codes
| Status code | Descrição | 
|---|---|
| 202 | Accepted | 
Amostras de código
curl \
  -X PATCH \
  -H "Accept: application/vnd.github.v3+json" \ 
  -H "Authorization: token <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"
}