Copilot

Endpoints to manage Copilot using the REST API.

Operations

MethodEndpointDescription
GET/enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-dayGet Copilot enterprise usage metrics for a specific day
GET/enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latestGet Copilot enterprise usage metrics
GET/enterprises/{enterprise}/copilot/metrics/reports/repos-1-dayGet Copilot enterprise repository report for a specific day
GET/enterprises/{enterprise}/copilot/metrics/reports/user-teams-1-dayGet Copilot enterprise user-teams report for a specific day
GET/enterprises/{enterprise}/copilot/metrics/reports/users-1-dayGet Copilot users usage metrics for a specific day
GET/enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latestGet Copilot users usage metrics
PUT/enterprises/{enterprise}/copilot/policies/coding_agentSet the coding agent policy for an enterprise
POST/enterprises/{enterprise}/copilot/policies/coding_agent/organizationsAdd organizations to the enterprise coding agent policy
DELETE/enterprises/{enterprise}/copilot/policies/coding_agent/organizationsRemove organizations from the enterprise coding agent policy
GET/orgs/{org}/copilot/billingGet Copilot seat information and settings for an organization
GET/orgs/{org}/copilot/billing/seatsList all Copilot seat assignments for an organization
POST/orgs/{org}/copilot/billing/selected_teamsAdd teams to the Copilot subscription for an organization
DELETE/orgs/{org}/copilot/billing/selected_teamsRemove teams from the Copilot subscription for an organization
POST/orgs/{org}/copilot/billing/selected_usersAdd users to the Copilot subscription for an organization
DELETE/orgs/{org}/copilot/billing/selected_usersRemove users from the Copilot subscription for an organization
GET/orgs/{org}/copilot/coding-agent/permissionsGet Copilot cloud agent permissions for an organization
PUT/orgs/{org}/copilot/coding-agent/permissionsSet Copilot cloud agent permissions for an organization
GET/orgs/{org}/copilot/coding-agent/permissions/repositoriesList repositories enabled for Copilot cloud agent in an organization
PUT/orgs/{org}/copilot/coding-agent/permissions/repositoriesSet 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_exclusionGet Copilot content exclusion rules for an organization
PUT/orgs/{org}/copilot/content_exclusionSet Copilot content exclusion rules for an organization
GET/orgs/{org}/copilot/metrics/reports/organization-1-dayGet Copilot organization usage metrics for a specific day
GET/orgs/{org}/copilot/metrics/reports/organization-28-day/latestGet Copilot organization usage metrics
GET/orgs/{org}/copilot/metrics/reports/repos-1-dayGet Copilot organization repository report for a specific day
GET/orgs/{org}/copilot/metrics/reports/user-teams-1-dayGet Copilot organization user-teams report for a specific day
GET/orgs/{org}/copilot/metrics/reports/users-1-dayGet Copilot organization users usage metrics for a specific day
GET/orgs/{org}/copilot/metrics/reports/users-28-day/latestGet Copilot organization users usage metrics
GET/orgs/{org}/members/{username}/copilotGet Copilot seat assignment details for a user
GET/repos/{owner}/{repo}/copilot/cloud-agent/configurationGet 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.