Skip to main content

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2022-10-12. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise にアップグレードします。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせく� さい

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.

Organizations

The Organization Administration API allows you to create organizations on your enterprise.

It is only available to authenticated site administrators. Normal users will receive a 404 response if they try to access it.

Create an organization

パラメーター

Headers
Name, Type, Description
acceptstring

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

Body parameters
Name, Type, Description
loginstringRequired

The organization's username.

adminstringRequired

The login of the user who will manage this organization.

profile_namestring

The organization's display name.

HTTP 応答状態コード

status code説明
201

Created

コード サンプル

post/admin/organizations
curl \ -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://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

パラメーター

Headers
Name, Type, Description
acceptstring

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

Path parameters
Name, Type, Description
orgstringRequired

The organization name. The name is not case sensitive.

Body parameters
Name, Type, Description
loginstringRequired

The organization's new name.

HTTP 応答状態コード

status code説明
202

Accepted

コード サンプル

patch/admin/organizations/{org}
curl \ -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" }