Skip to main content

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.

ライセンス

ライセンス API は、Enterprise ライセンスに関する情報を提供します。

認証されたサイト管理者のみが使用できます。 通常のユーザーは、アクセスしようとすると 404 応答を受け取ります。

List enterprise consumed licenses

Lists the license consumption information for all users, including those from connected servers, associated with an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the read:enterprise scope.

Note: The license consumption API endpoints for enterprise accounts are currently in Beta and are subject to change.

パラメーター

Headers
Name, Type, Description
acceptstring

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

Path parameters
Name, Type, Description
enterprisestringRequired

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Query parameters
Name, Type, Description
per_pageinteger

The number of results per page (max 100).

Default: 30

pageinteger

Page number of the results to fetch.

Default: 1

HTTP 応答状態コード

status code説明
200

Consumed Licenses Response

コード サンプル

get/enterprises/{enterprise}/consumed-licenses
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://api.github.com/enterprises/ENTERPRISE/consumed-licenses

Consumed Licenses Response

Status: 200
{ "total_seats_consumed": 5000, "total_seats_purchased": 4500, "users": [ { "enterprise_server_emails": [ "monalisa@github.com" ], "github_com_login": "monalisa", "github_com_name": "Mona Lisa", "github_com_profile": "https://github.com/monalisa", "license_type": "enterprise", "github_com_member_roles": [ "org1:Owner", "org2:Owner" ], "github_com_enterprise_role": "owner", "github_com_enterprise_roles": [ "owner" ], "visual_studio_subscription_user": false, "github_com_verified_domain_emails": [ "monalisa@github.com" ], "github_com_saml_name_id": "monalisa", "enterprise_server_user": true, "github_com_user": true, "total_user_accounts": 3, "enterprise_server_user_ids": [ "example_host_name.com:123", "example_host_name_2:222" ], "github_com_orgs_with_pending_invites": [ "org1", "org2" ], "visual_studio_subscription_email": "" }, { "enterprise_server_emails": [ "deleonjavier@example.com" ], "github_com_login": "", "github_com_name": "", "github_com_profile": "", "license_type": "enterprise", "github_com_member_roles": [], "github_com_enterprise_role": "", "github_com_enterprise_roles": [], "visual_studio_subscription_user": false, "github_com_verified_domain_emails": [], "github_com_saml_name_id": "", "enterprise_server_user": true, "github_com_user": false, "total_user_accounts": 1, "enterprise_server_user_ids": [ "example_host_name:123" ], "github_com_orgs_with_pending_invites": [], "visual_studio_subscription_email": "" } ] }

Get a license sync status

Gets information about the status of a license sync job for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the read:enterprise scope.

パラメーター

Headers
Name, Type, Description
acceptstring

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

Path parameters
Name, Type, Description
enterprisestringRequired

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

HTTP 応答状態コード

status code説明
200

License Sync Status Response

コード サンプル

get/enterprises/{enterprise}/license-sync-status
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://api.github.com/enterprises/ENTERPRISE/license-sync-status

License 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": "" } } ] }