エンタープライズ ライセンス用の REST API エンドポイント
この REST API を使って、エンタープライズ ライセンスに関する情報を取得します。
これらのエンドポイントは、認証されたサイト管理者のみが使用できます。 通常のユーザーは 404 応答を受け取ります。
メモ
これらのエンドポイントでは、personal access token (classic) を使う認証のみがサポートされます。 詳しくは、「個人用アクセス トークンを管理する」をご覧ください。
List enterprise consumed licenses
Lists the license consumption information for all users, including those from connected servers, associated with an enterprise.
The authenticated user must be an enterprise admin to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the read:enterprise scope to use this endpoint.
"List enterprise consumed licenses" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" enterprise permissions (read)
"List enterprise consumed licenses" のパラメーター
| 名前, Type, 説明 | 
|---|
| acceptstringSetting to  | 
| 名前, Type, 説明 | 
|---|
| enterprisestring 必須The slug version of the enterprise name. | 
| 名前, Type, 説明 | 
|---|
| per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API." Default:  | 
| pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API." Default:  | 
"List enterprise consumed licenses" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
| 200 | Consumed Licenses Response | 
"List enterprise consumed licenses" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com を api.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/enterprises/ENTERPRISE/consumed-licensesConsumed Licenses Response
Status: 200{
  "total_seats_consumed": 5000,
  "total_seats_purchased": 4500,
  "users": [
    {
      "github_com_login": "monalisa",
      "github_com_name": "Mona Lisa",
      "enterprise_server_user_ids": [
        "example_host_name.com:123",
        "example_host_name_2:222"
      ],
      "github_com_user": true,
      "enterprise_server_user": true,
      "visual_studio_subscription_user": false,
      "license_type": "enterprise",
      "github_com_profile": "https://github.com/monalisa",
      "github_com_member_roles": [
        "org1:Owner",
        "org2:Owner"
      ],
      "github_com_enterprise_roles": [
        "owner"
      ],
      "github_com_verified_domain_emails": [
        "monalisa@github.com"
      ],
      "github_com_saml_name_id": "monalisa",
      "github_com_orgs_with_pending_invites": [
        "org1",
        "org2"
      ],
      "github_com_two_factor_auth": true,
      "enterprise_server_emails": [
        "monalisa@github.com"
      ],
      "visual_studio_license_status": "",
      "visual_studio_subscription_email": "",
      "total_user_accounts": 3
    },
    {
      "github_com_login": "",
      "github_com_name": "",
      "enterprise_server_user_ids": [
        "example_host_name:123"
      ],
      "github_com_user": false,
      "enterprise_server_user": true,
      "visual_studio_subscription_user": false,
      "license_type": "enterprise",
      "github_com_profile": "",
      "github_com_member_roles": [],
      "github_com_enterprise_role": "",
      "github_com_enterprise_roles": [],
      "github_com_verified_domain_emails": [],
      "github_com_saml_name_id": "",
      "github_com_orgs_with_pending_invites": [],
      "github_com_two_factor_auth": "",
      "enterprise_server_emails": [
        "hubot@example.com"
      ],
      "visual_studio_license_status": "",
      "visual_studio_subscription_email": "",
      "total_user_accounts": 1
    }
  ]
}Get a license sync status
Gets information about the status of a license sync job for an enterprise.
The authenticated user must be an enterprise admin to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the read:enterprise scope to use this endpoint.
"Get a license sync status" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Enterprise administration" enterprise permissions (read)
"Get a license sync status" のパラメーター
| 名前, Type, 説明 | 
|---|
| acceptstringSetting to  | 
| 名前, Type, 説明 | 
|---|
| enterprisestring 必須The slug version of the enterprise name. | 
"Get a license sync status" の HTTP 応答状態コード
| 状態コード | 説明 | 
|---|---|
| 200 | License Sync Status Response | 
"Get a license sync status" のコード サンプル
GHE.com で GitHub にアクセスする場合は、api.github.com を api.SUBDOMAIN.ghe.com にあるエンタープライズの専用サブドメインに置き換えます。
要求の例
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/enterprises/ENTERPRISE/license-sync-statusLicense Sync Status Response
Status: 200{
  "server_instances": [
    {
      "server_id": "deadbeef1",
      "hostname": "github.example.com",
      "last_sync": {
        "date": "2020-01-01T00:00:00Z",
        "status": "success",
        "error": ""
      }
    },
    {
      "server_id": "filetoffish1",
      "hostname": "github2.example.com",
      "last_sync": {
        "date": "2020-01-01T00:00:00Z",
        "status": "success",
        "error": ""
      }
    }
  ]
}