Copilot
Endpoints to manage Copilot using the REST API.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day | Get Copilot enterprise usage metrics for a specific day |
GET | /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest | Get Copilot enterprise usage metrics |
GET | /enterprises/{enterprise}/copilot/metrics/reports/repos-1-day | Get Copilot enterprise repository report for a specific day |
GET | /enterprises/{enterprise}/copilot/metrics/reports/user-teams-1-day | Get Copilot enterprise user-teams report for a specific day |
GET | /enterprises/{enterprise}/copilot/metrics/reports/users-1-day | Get Copilot users usage metrics for a specific day |
GET | /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest | Get Copilot users usage metrics |
PUT | /enterprises/{enterprise}/copilot/policies/coding_agent | Set the coding agent policy for an enterprise |
POST | /enterprises/{enterprise}/copilot/policies/coding_agent/organizations | Add organizations to the enterprise coding agent policy |
DELETE | /enterprises/{enterprise}/copilot/policies/coding_agent/organizations | Remove organizations from the enterprise coding agent policy |
GET | /orgs/{org}/copilot/billing | Get Copilot seat information and settings for an organization |
GET | /orgs/{org}/copilot/billing/seats | List all Copilot seat assignments for an organization |
POST | /orgs/{org}/copilot/billing/selected_teams | Add teams to the Copilot subscription for an organization |
DELETE | /orgs/{org}/copilot/billing/selected_teams | Remove teams from the Copilot subscription for an organization |
POST | /orgs/{org}/copilot/billing/selected_users | Add users to the Copilot subscription for an organization |
DELETE | /orgs/{org}/copilot/billing/selected_users | Remove users from the Copilot subscription for an organization |
GET | /orgs/{org}/copilot/coding-agent/permissions | Get Copilot cloud agent permissions for an organization |
PUT | /orgs/{org}/copilot/coding-agent/permissions | Set Copilot cloud agent permissions for an organization |
GET | /orgs/{org}/copilot/coding-agent/permissions/repositories | List repositories enabled for Copilot cloud agent in an organization |
PUT | /orgs/{org}/copilot/coding-agent/permissions/repositories | Set selected repositories for Copilot cloud agent in an organization |
PUT | /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id} | Enable a repository for Copilot cloud agent in an organization |
DELETE | /orgs/{org}/copilot/coding-agent/permissions/repositories/{repository_id} | Disable a repository for Copilot cloud agent in an organization |
GET | /orgs/{org}/copilot/content_exclusion | Get Copilot content exclusion rules for an organization |
PUT | /orgs/{org}/copilot/content_exclusion | Set Copilot content exclusion rules for an organization |
GET | /orgs/{org}/copilot/metrics/reports/organization-1-day | Get Copilot organization usage metrics for a specific day |
GET | /orgs/{org}/copilot/metrics/reports/organization-28-day/latest | Get Copilot organization usage metrics |
GET | /orgs/{org}/copilot/metrics/reports/repos-1-day | Get Copilot organization repository report for a specific day |
GET | /orgs/{org}/copilot/metrics/reports/user-teams-1-day | Get Copilot organization user-teams report for a specific day |
GET | /orgs/{org}/copilot/metrics/reports/users-1-day | Get Copilot organization users usage metrics for a specific day |
GET | /orgs/{org}/copilot/metrics/reports/users-28-day/latest | Get Copilot organization users usage metrics |
GET | /orgs/{org}/members/{username}/copilot | Get Copilot seat assignment details for a user |
GET | /repos/{owner}/{repo}/copilot/cloud-agent/configuration | Get Copilot cloud agent configuration for a repository |
Example
Get Copilot enterprise usage metrics for a specific day, with the TypeScript SDK:
ts
import { GitHubV3REST } from "github";
const client = new GitHubV3REST({
baseUrl: "https://api.github.com",
});
const result = await client.copilot.copilotEnterpriseOneDayUsageMetrics({
enterprise: "enterprise",
day: {},
});
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.