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/licenses endpoint; the API token needs admin:org scope.

  • B

    Use the POST /orgs/{org}/copilot/assign-license endpoint; the API token needs write:org scope.

  • C

    Use the GET /orgs/{org}/copilot/subscriptions endpoint; the API token needs admin:org scope.

  • D

    Use the GET /users/{username}/copilot/licenses endpoint; the API token needs read:org scope.

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.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need