Github Copilot · Free Practice Question Medium
Question 37
As an IT administrator managing GitHub Copilot Business, you need to automate subscription management using GitHub’s REST API. Which API endpoint and method should you use to list active Copilot subscriptions, and what permissions are required?
-
A
Use the
GET /orgs/{org}/copilot/licensesendpoint; the API token needsadmin:orgscope. -
B
Use the
POST /orgs/{org}/copilot/assign-licenseendpoint; the API token needswrite:orgscope. -
C
Use the
GET /orgs/{org}/copilot/subscriptionsendpoint; the API token needsadmin:orgscope. -
D
Use the
GET /users/{username}/copilot/licensesendpoint; the API token needsread:orgscope.
Reveal correct answer
Correct answer: C
A.
This is incorrect because while admin:org is the correct scope, there is no specific endpoint named GET /orgs/{org}/copilot/licenses. The correct endpoint is GET /orgs/{org}/copilot/subscriptions to retrieve the list of active subscriptions. The confusion may arise from misunderstanding the terminology of licenses versus subscriptions.
B.
This is incorrect because while the API does support assigning licenses, there is no POST /orgs/{org}/copilot/assign-license endpoint. Assigning licenses via the API would require a different approach, and the scope needed would be admin:org rather than write:org, which is typically for making changes to repository content.
C.
This is the correct answer because the GET /orgs/{org}/copilot/subscriptions endpoint is used to retrieve a list of active GitHub Copilot Business subscriptions for an organization. The API token needs the admin:org scope, which is required to access and manage organizational resources such as Copilot subscriptions.
D.
This is incorrect because there is no such endpoint as GET /users/{username}/copilot/licenses in the GitHub API. Additionally, managing Copilot licenses is typically an organizational concern, not specific to individual users, and requires higher-level access such as admin:org rather than read:org.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
