REST API はバージョン化されました。 詳細については、「API のバージョン管理について」を参照してください。
エンタープライズの組織用の REST API エンドポイント
この REST API を使って、企業の組織を作成します。
組織の管理について
これらのエンドポイントは、認証されたサイト管理者のみが使用できます。 通常のユーザーは 404 応答を受け取ります。
メモ
これらのエンドポイントでは、personal access token (classic) を使う認証のみがサポートされます。 詳しくは、「個人用アクセス トークンを管理する」をご覧ください。
Create an organization
fine_grained_access
no_fine_grained_access
"Create an organization" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
login string 必須The organization's username. |
admin string 必須The login of the user who will manage this organization. |
profile_name string The organization's display name. |
http_status_code
| status_code | 説明 |
|---|---|
201 | Created |
code_samples
request_example
post/admin/organizations
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
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
fine_grained_access
no_fine_grained_access
"Update an organization name" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
org string 必須The organization name. The name is not case sensitive. |
| 名前, タイプ, 説明 |
|---|
login string 必須The organization's new name. |
http_status_code
| status_code | 説明 |
|---|---|
202 | Accepted |
code_samples
request_example
patch /admin /organizations /{org}
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
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"
}