🤖 Copilot for Business User Management API (beta) #60780
Replies: 14 comments 26 replies
-
The https://api.github.com/organizations/ORG/copilot/billing endpoint give the seat breakdown. By any chance, will it be possible in the future to have a https://api.github.com/organizations/ORG/copilot/billing/detail endpoint with the list of user for each status ( "added_this_cycle", "pending_invitation", "pending_cancellation", "active_this_cycle", "inactive_this_cycle") ? Well At least it would be nice to have the "active_this_cycle" detail for internal billing |
Beta Was this translation helpful? Give feedback.
-
I get a 404 response. Is this endpoint for GitHub Enterprise only or otherwise gated? {
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest"
} UPDATE: To fix the problem do:
|
Beta Was this translation helpful? Give feedback.
-
@2percentsilk I think there's a typo in the docs for 2 of the route names from https://docs.github.com/en/rest/copilot/copilot-for-business?apiVersion=2022-11-28
these are both prefixed with |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Great new API's! I was looking out for this one. Question: Background: Thanks! |
Beta Was this translation helpful? Give feedback.
-
Is it possible to get below data: |
Beta Was this translation helpful? Give feedback.
-
We have an integration using the authenticate as a github app / installation token approach, This is a background job running from various events, no user interaction - so the IAT approach is appropriate. Up until now, this has been doing some basic team setup & maintenance. i.e. generate a JWT using the private key associated with the app, exchange for an installation token, public async Task<GitHubClient> GetGitHubInstallationClient()
{
var jwtToken = PemToJwtGenerator.GenerateGithubAppJwtFromPem(_privateKey, _appId);
var appClient = new GitHubClient(new ProductHeaderValue("MyApp"))
{
Credentials = new Credentials(jwtToken, AuthenticationType.Bearer)
};
var installationTokenResponse = await appClient.GitHubApps.CreateInstallationToken(_installationId);
var installationClient = new GitHubClient(new ProductHeaderValue("MyApp"))
{
Credentials = new Credentials(installationTokenResponse.Token)
};
return installationClient;
} I've just granted the app write permissions for 'GitHub Copilot for Business' and that scope is returned in the token, as per Attempt to call the {"message":"Seat assignment for user xxx-xxx could not be created: Inviting User is not an admin of the organization",
"documentation_url":"https://docs.github.com/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization"} OK - docs are pretty clear that the access token needs to be an admin on the org it's targeting - is the 'auth as app' flow supported in this scenario or need to change approach? If supported - what am I missing to grant the app the permissions it requires? Thanks |
Beta Was this translation helpful? Give feedback.
-
I'm calling /copilot/billing/seats to get the current list of allocated seats. I'm using the Octokit c# connection for this, e.g. var targetUri = new Uri(_githubConnection.BaseAddress, $"orgs/{AsosTeamOrgName}/copilot/billing/seats");
var response = await _githubConnection.Get<AllocatedSeatsResponse>(targetUri, parameters); This is currently throwing an exception
Which seems due to the pending_cancellation_date field, e.g. "pending_cancellation_date": "2023-08-01" Seems similar to this report and issue (octokit/octokit.net#1785 (comment)), worth keeping the date format aligned with all other date responses? |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to implement the next link in the header if there is multiple pages of results ? |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to change the required access for GET endpoints from GET /orgs/{org}/copilot/billing |
Beta Was this translation helpful? Give feedback.
-
Support for the API is now available in octokit.net - https://github.com/octokit/octokit.net/releases/tag/v9.1.0 I haven't finished all the endpoints yet - but there's enough there that should enable some automated license allocation/clear up for people. Another PR to come shortly that'll finish the remaining endpoints. |
Beta Was this translation helpful? Give feedback.
-
When will we have some more helpful metrics about our organization's Copilot usage? Just giving us a csv report dump with status, team, last activity date, and last editor used isn't enough to understand what productivity gains we may be getting. Rather than use global averages, I'd like to know how my organization is using it: how many lines accepted, usage over time, activity distribution between inline suggestions and Chat features, etc. How might I get that on a team or user level, and if not yet, when might I expect to? Surely many organizations are asking this. |
Beta Was this translation helpful? Give feedback.
-
Hi Team URL: https://api.github.com/orgs/{org_name}/copilot/usage |
Beta Was this translation helpful? Give feedback.
-
We've just released our beta version of the User Management API for GitHub Copilot for Business.
Note: You must authenticate using an access token with the
manage_billing:copilot scope
and be an admin on the Copilot for Business organization you're updating to use this endpoint.We'd love for you to try it out and let us know what you think!
Beta Was this translation helpful? Give feedback.
All reactions