diff --git a/content/rest/copilot/copilot-metrics.md b/content/rest/copilot/copilot-metrics.md new file mode 100644 index 000000000000..55282cd999c9 --- /dev/null +++ b/content/rest/copilot/copilot-metrics.md @@ -0,0 +1,14 @@ +--- +title: REST API endpoints for Copilot metrics +shortTitle: Copilot metrics +intro: Use the REST API to view Copilot metrics. +versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 + fpt: '*' + ghec: '*' +topics: + - API +autogenerated: rest +allowTitleToDifferFromFilename: true +--- + + diff --git a/content/rest/copilot/index.md b/content/rest/copilot/index.md index 2a9a9f683606..a704cb30b88f 100644 --- a/content/rest/copilot/index.md +++ b/content/rest/copilot/index.md @@ -10,6 +10,7 @@ topics: autogenerated: rest allowTitleToDifferFromFilename: true children: + - /copilot-metrics - /copilot-usage - /copilot-user-management versions: diff --git a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json index 0629285aca10..ff43803e713e 100644 --- a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json +++ b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat-permissions.json @@ -291,6 +291,15 @@ "additional-permissions": true, "access": "write" }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "additional-permissions": true, + "access": "read" + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-organization-members", @@ -462,6 +471,15 @@ "additional-permissions": false, "access": "read" }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "additional-permissions": true, + "access": "read" + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-a-team", @@ -690,6 +708,15 @@ "additional-permissions": true, "access": "write" }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "additional-permissions": true, + "access": "read" + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-organization-members", @@ -708,6 +735,15 @@ "additional-permissions": true, "access": "read" }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "additional-permissions": true, + "access": "read" + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-a-team", diff --git a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json index 46760e6544a6..5a7cbbf8c16d 100644 --- a/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json +++ b/src/github-apps/data/fpt-2022-11-28/fine-grained-pat.json @@ -2030,6 +2030,12 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-organization-members", "subcategory": "copilot-usage", @@ -2042,6 +2048,12 @@ "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" }, + { + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-a-team", "subcategory": "copilot-usage", diff --git a/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json b/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json index fd23dc84ada8..35578322cf0c 100644 --- a/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json +++ b/src/github-apps/data/fpt-2022-11-28/server-to-server-permissions.json @@ -14,6 +14,17 @@ "server-to-server": false, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-enterprise", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/copilot/metrics", + "access": "read", + "user-to-server": false, + "server-to-server": false, + "additional-permissions": false + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-enterprise-members", @@ -25,6 +36,17 @@ "server-to-server": false, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-enterprise-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/team/{team_slug}/copilot/metrics", + "access": "read", + "user-to-server": false, + "server-to-server": false, + "additional-permissions": false + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-an-enterprise-team", @@ -394,6 +416,17 @@ "server-to-server": true, "additional-permissions": true }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-organization-members", @@ -603,6 +636,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-a-team", @@ -875,6 +919,17 @@ "server-to-server": true, "additional-permissions": true }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-organization-members", @@ -897,6 +952,17 @@ "server-to-server": true, "additional-permissions": true }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-a-team", diff --git a/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json b/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json index d128afd8ec0a..564a4ad4524c 100644 --- a/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json +++ b/src/github-apps/data/fpt-2022-11-28/server-to-server-rest.json @@ -1758,6 +1758,12 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-organization-members", "subcategory": "copilot-usage", @@ -1770,6 +1776,12 @@ "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" }, + { + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-a-team", "subcategory": "copilot-usage", diff --git a/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json b/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json index 46760e6544a6..5a7cbbf8c16d 100644 --- a/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json +++ b/src/github-apps/data/fpt-2022-11-28/user-to-server-rest.json @@ -2030,6 +2030,12 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-organization-members", "subcategory": "copilot-usage", @@ -2042,6 +2048,12 @@ "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" }, + { + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-a-team", "subcategory": "copilot-usage", diff --git a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json index 953d84b99cd6..420c95dbf35b 100644 --- a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json +++ b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat-permissions.json @@ -522,6 +522,15 @@ "additional-permissions": true, "access": "write" }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "additional-permissions": true, + "access": "read" + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-organization-members", @@ -765,6 +774,15 @@ "additional-permissions": false, "access": "read" }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "additional-permissions": true, + "access": "read" + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-a-team", @@ -1143,6 +1161,15 @@ "additional-permissions": true, "access": "write" }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "additional-permissions": true, + "access": "read" + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-organization-members", @@ -1161,6 +1188,15 @@ "additional-permissions": true, "access": "read" }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "additional-permissions": true, + "access": "read" + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-a-team", diff --git a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json index c1ff41097989..14ecf7818639 100644 --- a/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json +++ b/src/github-apps/data/ghec-2022-11-28/fine-grained-pat.json @@ -2068,6 +2068,12 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-organization-members", "subcategory": "copilot-usage", @@ -2080,6 +2086,12 @@ "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" }, + { + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-a-team", "subcategory": "copilot-usage", diff --git a/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json b/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json index afafb49ada50..26f813356882 100644 --- a/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json +++ b/src/github-apps/data/ghec-2022-11-28/server-to-server-permissions.json @@ -69,6 +69,17 @@ "server-to-server": false, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-enterprise", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/copilot/metrics", + "access": "read", + "user-to-server": false, + "server-to-server": false, + "additional-permissions": false + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-enterprise-members", @@ -179,6 +190,17 @@ "server-to-server": false, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-enterprise-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/team/{team_slug}/copilot/metrics", + "access": "read", + "user-to-server": false, + "server-to-server": false, + "additional-permissions": false + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-an-enterprise-team", @@ -713,6 +735,17 @@ "server-to-server": true, "additional-permissions": true }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-organization-members", @@ -1010,6 +1043,17 @@ "server-to-server": true, "additional-permissions": false }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-a-team", @@ -1464,6 +1508,17 @@ "server-to-server": true, "additional-permissions": true }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-organization-members", @@ -1486,6 +1541,17 @@ "server-to-server": true, "additional-permissions": true }, + { + "category": "copilot", + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "access": "read", + "user-to-server": true, + "server-to-server": true, + "additional-permissions": true + }, { "category": "copilot", "slug": "get-a-summary-of-copilot-usage-for-a-team", diff --git a/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json b/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json index 7a0107e51f09..5c8290e7c105 100644 --- a/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json +++ b/src/github-apps/data/ghec-2022-11-28/server-to-server-rest.json @@ -1796,6 +1796,12 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-organization-members", "subcategory": "copilot-usage", @@ -1808,6 +1814,12 @@ "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" }, + { + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-a-team", "subcategory": "copilot-usage", diff --git a/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json b/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json index c1ff41097989..14ecf7818639 100644 --- a/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json +++ b/src/github-apps/data/ghec-2022-11-28/user-to-server-rest.json @@ -2068,6 +2068,12 @@ "verb": "delete", "requestPath": "/orgs/{org}/copilot/billing/selected_users" }, + { + "slug": "get-copilot-metrics-for-an-organization", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-organization-members", "subcategory": "copilot-usage", @@ -2080,6 +2086,12 @@ "verb": "get", "requestPath": "/orgs/{org}/members/{username}/copilot" }, + { + "slug": "get-copilot-metrics-for-a-team", + "subcategory": "copilot-metrics", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics" + }, { "slug": "get-a-summary-of-copilot-usage-for-a-team", "subcategory": "copilot-usage", diff --git a/src/github-apps/lib/config.json b/src/github-apps/lib/config.json index 60d425ca2080..33aa339365cf 100644 --- a/src/github-apps/lib/config.json +++ b/src/github-apps/lib/config.json @@ -60,5 +60,5 @@ "2022-11-28" ] }, - "sha": "7c6cc4ee9c2354d4093640bec365415ddd1c3506" + "sha": "c8e5a99583a3fd250dada63a4a9f5c4fffc53409" } \ No newline at end of file diff --git a/src/rest/data/fpt-2022-11-28/schema.json b/src/rest/data/fpt-2022-11-28/schema.json index 101d611e258e..4aa0487a6663 100644 --- a/src/rest/data/fpt-2022-11-28/schema.json +++ b/src/rest/data/fpt-2022-11-28/schema.json @@ -222697,6 +222697,2350 @@ ] }, "copilot": { + "copilot-metrics": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/copilot/metrics", + "title": "Get Copilot metrics for an enterprise", + "category": "copilot", + "subcategory": "copilot-metrics", + "parameters": [ + { + "name": "enterprise", + "description": "

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "

Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "

The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": false, + "serverToServer": false, + "fineGrainedPat": false, + "permissions": [ + { + "\"Enterprise administration\" business permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "enterprise": "ENTERPRISE" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Copilot usage metrics for a given day.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "total_engaged_users": { + "type": "integer", + "description": "The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "copilot_ide_code_completions": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot editor code completions in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances." + } + } + } + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot code completion metrics for active editors.", + "additionalProperties": true, + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages, for the given editor.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_suggestions": { + "type": "integer", + "description": "The number of Copilot code suggestions generated for the given editor, for the given language." + }, + "total_code_acceptances": { + "type": "integer", + "description": "The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot code completions for the given editor, for the given language." + }, + "total_code_lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language." + } + } + } + } + } + } + } + } + } + } + } + }, + "copilot_ide_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat in the IDE." + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot Chat metrics, for active editors.", + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the specified editor." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the given editor and model." + }, + "total_chats": { + "type": "integer", + "description": "The total number of chats initiated by users in the given editor and model." + }, + "total_chat_insertion_events": { + "type": "integer", + "description": "The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor." + }, + "total_chat_copy_events": { + "type": "integer", + "description": "The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor." + } + } + } + } + } + } + } + } + }, + "copilot_dotcom_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in github.com", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once." + }, + "models": { + "type": "array", + "description": "List of model metrics for a custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model (if applicable)." + }, + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once for each model." + }, + "total_chats": { + "type": "integer", + "description": "Total number of chats initiated by users on github.com." + } + } + } + } + } + }, + "copilot_dotcom_pull_requests": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot for pull requests.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once." + }, + "repositories": { + "type": "array", + "description": "Repositories in which users used Copilot for Pull Requests to generate pull request summaries", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name" + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_pr_summaries_created": { + "type": "integer", + "description": "The number of pull request summaries generated using Copilot for Pull Requests in the given repository." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model." + } + } + } + } + } + } + } + } + } + }, + "required": [ + "date" + ], + "additionalProperties": true + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

\n

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.

\n

To access this endpoint, the Copilot Metrics API access policy must be enabled or set to \"no policy\" for the enterprise within GitHub settings.\nOnly enterprise owners and billing managers can view Copilot metrics for the enterprise.

\n

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "403", + "description": "

Forbidden

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Copilot Usage Merics API setting is disabled at the organization or enterprise level.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/team/{team_slug}/copilot/metrics", + "title": "Get Copilot metrics for an enterprise team", + "category": "copilot", + "subcategory": "copilot-metrics", + "parameters": [ + { + "name": "enterprise", + "description": "

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "team_slug", + "description": "

The slug of the enterprise team name.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "

Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "

The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": false, + "serverToServer": false, + "fineGrainedPat": false, + "permissions": [ + { + "\"Enterprise administration\" business permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "enterprise": "ENTERPRISE", + "team_slug": "TEAM_SLUG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Copilot usage metrics for a given day.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "total_engaged_users": { + "type": "integer", + "description": "The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "copilot_ide_code_completions": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot editor code completions in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances." + } + } + } + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot code completion metrics for active editors.", + "additionalProperties": true, + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages, for the given editor.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_suggestions": { + "type": "integer", + "description": "The number of Copilot code suggestions generated for the given editor, for the given language." + }, + "total_code_acceptances": { + "type": "integer", + "description": "The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot code completions for the given editor, for the given language." + }, + "total_code_lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language." + } + } + } + } + } + } + } + } + } + } + } + }, + "copilot_ide_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat in the IDE." + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot Chat metrics, for active editors.", + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the specified editor." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the given editor and model." + }, + "total_chats": { + "type": "integer", + "description": "The total number of chats initiated by users in the given editor and model." + }, + "total_chat_insertion_events": { + "type": "integer", + "description": "The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor." + }, + "total_chat_copy_events": { + "type": "integer", + "description": "The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor." + } + } + } + } + } + } + } + } + }, + "copilot_dotcom_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in github.com", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once." + }, + "models": { + "type": "array", + "description": "List of model metrics for a custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model (if applicable)." + }, + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once for each model." + }, + "total_chats": { + "type": "integer", + "description": "Total number of chats initiated by users on github.com." + } + } + } + } + } + }, + "copilot_dotcom_pull_requests": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot for pull requests.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once." + }, + "repositories": { + "type": "array", + "description": "Repositories in which users used Copilot for Pull Requests to generate pull request summaries", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name" + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_pr_summaries_created": { + "type": "integer", + "description": "The number of pull request summaries generated using Copilot for Pull Requests in the given repository." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model." + } + } + } + } + } + } + } + } + } + }, + "required": [ + "date" + ], + "additionalProperties": true + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

\n

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.

\n

Note

\n

\nThis endpoint will only return results for a given day if the enterprise team had five or more members with active Copilot licenses on that day, as evaluated at the end of that day.

\n
\n

To access this endpoint, the Copilot Metrics API access policy must be enabled or set to \"no policy\" for the enterprise within GitHub settings.\nOnly owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.

\n

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "403", + "description": "

Forbidden

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Copilot Usage Merics API setting is disabled at the organization or enterprise level.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "title": "Get Copilot metrics for an organization", + "category": "copilot", + "subcategory": "copilot-metrics", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "

Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "

The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "\"GitHub Copilot Business\" organization permissions": "read" + }, + { + "\"Administration\" organization permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Copilot usage metrics for a given day.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "total_engaged_users": { + "type": "integer", + "description": "The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "copilot_ide_code_completions": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot editor code completions in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances." + } + } + } + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot code completion metrics for active editors.", + "additionalProperties": true, + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages, for the given editor.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_suggestions": { + "type": "integer", + "description": "The number of Copilot code suggestions generated for the given editor, for the given language." + }, + "total_code_acceptances": { + "type": "integer", + "description": "The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot code completions for the given editor, for the given language." + }, + "total_code_lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language." + } + } + } + } + } + } + } + } + } + } + } + }, + "copilot_ide_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat in the IDE." + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot Chat metrics, for active editors.", + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the specified editor." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the given editor and model." + }, + "total_chats": { + "type": "integer", + "description": "The total number of chats initiated by users in the given editor and model." + }, + "total_chat_insertion_events": { + "type": "integer", + "description": "The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor." + }, + "total_chat_copy_events": { + "type": "integer", + "description": "The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor." + } + } + } + } + } + } + } + } + }, + "copilot_dotcom_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in github.com", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once." + }, + "models": { + "type": "array", + "description": "List of model metrics for a custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model (if applicable)." + }, + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once for each model." + }, + "total_chats": { + "type": "integer", + "description": "Total number of chats initiated by users on github.com." + } + } + } + } + } + }, + "copilot_dotcom_pull_requests": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot for pull requests.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once." + }, + "repositories": { + "type": "array", + "description": "Repositories in which users used Copilot for Pull Requests to generate pull request summaries", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name" + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_pr_summaries_created": { + "type": "integer", + "description": "The number of pull request summaries generated using Copilot for Pull Requests in the given repository." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model." + } + } + } + } + } + } + } + } + } + }, + "required": [ + "date" + ], + "additionalProperties": true + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

\n

Note

\n

\nThis endpoint will only return results for a given day if the organization contained five or more members with active Copilot licenses on that day, as evaluated at the end of that day.

\n
\n

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.

\n

To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization.\nOnly organization owners and owners and billing managers of the parent enterprise can view Copilot metrics.

\n

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "403", + "description": "

Forbidden

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Copilot Usage Merics API setting is disabled at the organization or enterprise level.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "title": "Get Copilot metrics for a team", + "category": "copilot", + "subcategory": "copilot-metrics", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "team_slug", + "description": "

The slug of the team name.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "

Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "

The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "\"GitHub Copilot Business\" organization permissions": "read" + }, + { + "\"Administration\" organization permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG", + "team_slug": "TEAM_SLUG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Copilot usage metrics for a given day.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "total_engaged_users": { + "type": "integer", + "description": "The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "copilot_ide_code_completions": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot editor code completions in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances." + } + } + } + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot code completion metrics for active editors.", + "additionalProperties": true, + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages, for the given editor.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_suggestions": { + "type": "integer", + "description": "The number of Copilot code suggestions generated for the given editor, for the given language." + }, + "total_code_acceptances": { + "type": "integer", + "description": "The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot code completions for the given editor, for the given language." + }, + "total_code_lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language." + } + } + } + } + } + } + } + } + } + } + } + }, + "copilot_ide_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat in the IDE." + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot Chat metrics, for active editors.", + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the specified editor." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the given editor and model." + }, + "total_chats": { + "type": "integer", + "description": "The total number of chats initiated by users in the given editor and model." + }, + "total_chat_insertion_events": { + "type": "integer", + "description": "The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor." + }, + "total_chat_copy_events": { + "type": "integer", + "description": "The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor." + } + } + } + } + } + } + } + } + }, + "copilot_dotcom_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in github.com", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once." + }, + "models": { + "type": "array", + "description": "List of model metrics for a custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model (if applicable)." + }, + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once for each model." + }, + "total_chats": { + "type": "integer", + "description": "Total number of chats initiated by users on github.com." + } + } + } + } + } + }, + "copilot_dotcom_pull_requests": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot for pull requests.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once." + }, + "repositories": { + "type": "array", + "description": "Repositories in which users used Copilot for Pull Requests to generate pull request summaries", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name" + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_pr_summaries_created": { + "type": "integer", + "description": "The number of pull request summaries generated using Copilot for Pull Requests in the given repository." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model." + } + } + } + } + } + } + } + } + } + }, + "required": [ + "date" + ], + "additionalProperties": true + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

\n

Note

\n

\nThis endpoint will only return results for a given day if the team had five or more members with active Copilot licenses on that day, as evaluated at the end of that day.

\n
\n

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.

\n

To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings.\nOnly organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team.

\n

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "403", + "description": "

Forbidden

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Copilot Usage Merics API setting is disabled at the organization or enterprise level.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + } + ], "copilot-usage": [ { "serverUrl": "https://api.github.com", @@ -357067,7 +359411,7 @@ } ], "previews": [], - "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

", + "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

\n

Note

\n

\nRequests using a fine-grained access token will receive a 200 Success response with an empty list.

\n
", "statusCodes": [ { "httpStatusCode": "200", diff --git a/src/rest/data/ghec-2022-11-28/schema.json b/src/rest/data/ghec-2022-11-28/schema.json index 57a5132fcc7f..ecdb494b197d 100644 --- a/src/rest/data/ghec-2022-11-28/schema.json +++ b/src/rest/data/ghec-2022-11-28/schema.json @@ -231657,6 +231657,2350 @@ ] }, "copilot": { + "copilot-metrics": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/copilot/metrics", + "title": "Get Copilot metrics for an enterprise", + "category": "copilot", + "subcategory": "copilot-metrics", + "parameters": [ + { + "name": "enterprise", + "description": "

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "

Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "

The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": false, + "serverToServer": false, + "fineGrainedPat": false, + "permissions": [ + { + "\"Enterprise administration\" business permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "enterprise": "ENTERPRISE" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Copilot usage metrics for a given day.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "total_engaged_users": { + "type": "integer", + "description": "The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "copilot_ide_code_completions": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot editor code completions in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances." + } + } + } + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot code completion metrics for active editors.", + "additionalProperties": true, + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages, for the given editor.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_suggestions": { + "type": "integer", + "description": "The number of Copilot code suggestions generated for the given editor, for the given language." + }, + "total_code_acceptances": { + "type": "integer", + "description": "The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot code completions for the given editor, for the given language." + }, + "total_code_lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language." + } + } + } + } + } + } + } + } + } + } + } + }, + "copilot_ide_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat in the IDE." + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot Chat metrics, for active editors.", + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the specified editor." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the given editor and model." + }, + "total_chats": { + "type": "integer", + "description": "The total number of chats initiated by users in the given editor and model." + }, + "total_chat_insertion_events": { + "type": "integer", + "description": "The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor." + }, + "total_chat_copy_events": { + "type": "integer", + "description": "The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor." + } + } + } + } + } + } + } + } + }, + "copilot_dotcom_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in github.com", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once." + }, + "models": { + "type": "array", + "description": "List of model metrics for a custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model (if applicable)." + }, + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once for each model." + }, + "total_chats": { + "type": "integer", + "description": "Total number of chats initiated by users on github.com." + } + } + } + } + } + }, + "copilot_dotcom_pull_requests": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot for pull requests.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once." + }, + "repositories": { + "type": "array", + "description": "Repositories in which users used Copilot for Pull Requests to generate pull request summaries", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name" + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_pr_summaries_created": { + "type": "integer", + "description": "The number of pull request summaries generated using Copilot for Pull Requests in the given repository." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model." + } + } + } + } + } + } + } + } + } + }, + "required": [ + "date" + ], + "additionalProperties": true + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

\n

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.

\n

To access this endpoint, the Copilot Metrics API access policy must be enabled or set to \"no policy\" for the enterprise within GitHub settings.\nOnly enterprise owners and billing managers can view Copilot metrics for the enterprise.

\n

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "403", + "description": "

Forbidden

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Copilot Usage Merics API setting is disabled at the organization or enterprise level.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/team/{team_slug}/copilot/metrics", + "title": "Get Copilot metrics for an enterprise team", + "category": "copilot", + "subcategory": "copilot-metrics", + "parameters": [ + { + "name": "enterprise", + "description": "

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "team_slug", + "description": "

The slug of the enterprise team name.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "

Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "

The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": false, + "serverToServer": false, + "fineGrainedPat": false, + "permissions": [ + { + "\"Enterprise administration\" business permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "enterprise": "ENTERPRISE", + "team_slug": "TEAM_SLUG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Copilot usage metrics for a given day.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "total_engaged_users": { + "type": "integer", + "description": "The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "copilot_ide_code_completions": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot editor code completions in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances." + } + } + } + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot code completion metrics for active editors.", + "additionalProperties": true, + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages, for the given editor.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_suggestions": { + "type": "integer", + "description": "The number of Copilot code suggestions generated for the given editor, for the given language." + }, + "total_code_acceptances": { + "type": "integer", + "description": "The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot code completions for the given editor, for the given language." + }, + "total_code_lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language." + } + } + } + } + } + } + } + } + } + } + } + }, + "copilot_ide_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat in the IDE." + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot Chat metrics, for active editors.", + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the specified editor." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the given editor and model." + }, + "total_chats": { + "type": "integer", + "description": "The total number of chats initiated by users in the given editor and model." + }, + "total_chat_insertion_events": { + "type": "integer", + "description": "The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor." + }, + "total_chat_copy_events": { + "type": "integer", + "description": "The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor." + } + } + } + } + } + } + } + } + }, + "copilot_dotcom_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in github.com", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once." + }, + "models": { + "type": "array", + "description": "List of model metrics for a custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model (if applicable)." + }, + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once for each model." + }, + "total_chats": { + "type": "integer", + "description": "Total number of chats initiated by users on github.com." + } + } + } + } + } + }, + "copilot_dotcom_pull_requests": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot for pull requests.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once." + }, + "repositories": { + "type": "array", + "description": "Repositories in which users used Copilot for Pull Requests to generate pull request summaries", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name" + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_pr_summaries_created": { + "type": "integer", + "description": "The number of pull request summaries generated using Copilot for Pull Requests in the given repository." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model." + } + } + } + } + } + } + } + } + } + }, + "required": [ + "date" + ], + "additionalProperties": true + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

\n

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.

\n

Note

\n

\nThis endpoint will only return results for a given day if the enterprise team had five or more members with active Copilot licenses on that day, as evaluated at the end of that day.

\n
\n

To access this endpoint, the Copilot Metrics API access policy must be enabled or set to \"no policy\" for the enterprise within GitHub settings.\nOnly owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.

\n

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "403", + "description": "

Forbidden

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Copilot Usage Merics API setting is disabled at the organization or enterprise level.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/copilot/metrics", + "title": "Get Copilot metrics for an organization", + "category": "copilot", + "subcategory": "copilot-metrics", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "

Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "

The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "\"GitHub Copilot Business\" organization permissions": "read" + }, + { + "\"Administration\" organization permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Copilot usage metrics for a given day.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "total_engaged_users": { + "type": "integer", + "description": "The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "copilot_ide_code_completions": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot editor code completions in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances." + } + } + } + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot code completion metrics for active editors.", + "additionalProperties": true, + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages, for the given editor.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_suggestions": { + "type": "integer", + "description": "The number of Copilot code suggestions generated for the given editor, for the given language." + }, + "total_code_acceptances": { + "type": "integer", + "description": "The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot code completions for the given editor, for the given language." + }, + "total_code_lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language." + } + } + } + } + } + } + } + } + } + } + } + }, + "copilot_ide_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat in the IDE." + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot Chat metrics, for active editors.", + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the specified editor." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the given editor and model." + }, + "total_chats": { + "type": "integer", + "description": "The total number of chats initiated by users in the given editor and model." + }, + "total_chat_insertion_events": { + "type": "integer", + "description": "The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor." + }, + "total_chat_copy_events": { + "type": "integer", + "description": "The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor." + } + } + } + } + } + } + } + } + }, + "copilot_dotcom_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in github.com", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once." + }, + "models": { + "type": "array", + "description": "List of model metrics for a custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model (if applicable)." + }, + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once for each model." + }, + "total_chats": { + "type": "integer", + "description": "Total number of chats initiated by users on github.com." + } + } + } + } + } + }, + "copilot_dotcom_pull_requests": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot for pull requests.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once." + }, + "repositories": { + "type": "array", + "description": "Repositories in which users used Copilot for Pull Requests to generate pull request summaries", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name" + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_pr_summaries_created": { + "type": "integer", + "description": "The number of pull request summaries generated using Copilot for Pull Requests in the given repository." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model." + } + } + } + } + } + } + } + } + } + }, + "required": [ + "date" + ], + "additionalProperties": true + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

\n

Note

\n

\nThis endpoint will only return results for a given day if the organization contained five or more members with active Copilot licenses on that day, as evaluated at the end of that day.

\n
\n

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.

\n

To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization.\nOnly organization owners and owners and billing managers of the parent enterprise can view Copilot metrics.

\n

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "403", + "description": "

Forbidden

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Copilot Usage Merics API setting is disabled at the organization or enterprise level.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + }, + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/orgs/{org}/team/{team_slug}/copilot/metrics", + "title": "Get Copilot metrics for a team", + "category": "copilot", + "subcategory": "copilot-metrics", + "parameters": [ + { + "name": "org", + "description": "

The organization name. The name is not case sensitive.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "team_slug", + "description": "

The slug of the team name.

", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "since", + "description": "

Show usage metrics since this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). Maximum value is 28 days ago.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "until", + "description": "

Show usage metrics until this date. This is a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and should not preceed the since date if it is passed.

", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "description": "

The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "description": "

The number of days of metrics to display per page (max 28). For more information, see \"Using pagination in the REST API.\"

", + "in": "query", + "schema": { + "type": "integer", + "default": 28 + } + } + ], + "bodyParameters": [], + "progAccess": { + "userToServerRest": true, + "serverToServer": true, + "fineGrainedPat": true, + "permissions": [ + { + "\"GitHub Copilot Business\" organization permissions": "read" + }, + { + "\"Administration\" organization permissions": "read" + } + ] + }, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "org": "ORG", + "team_slug": "TEAM_SLUG" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "

Response

", + "example": [ + { + "date": "2024-06-24", + "total_active_users": 24, + "total_engaged_users": 20, + "copilot_ide_code_completions": { + "total_engaged_users": 20, + "languages": [ + { + "name": "python", + "total_engaged_users": 10 + }, + { + "name": "ruby", + "total_engaged_users": 10 + } + ], + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 13, + "languages": [ + { + "name": "python", + "total_engaged_users": 6, + "total_code_suggestions": 249, + "total_code_acceptances": 123, + "total_code_lines_suggested": 225, + "total_code_lines_accepted": 135 + }, + { + "name": "ruby", + "total_engaged_users": 7, + "total_code_suggestions": 496, + "total_code_acceptances": 253, + "total_code_lines_suggested": 520, + "total_code_lines_accepted": 270 + } + ] + } + ] + }, + { + "name": "neovim", + "total_engaged_users": 7, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "languages": [ + { + "name": "typescript", + "total_engaged_users": 3, + "total_code_suggestions": 112, + "total_code_acceptances": 56, + "total_code_lines_suggested": 143, + "total_code_lines_accepted": 61 + }, + { + "name": "go", + "total_engaged_users": 4, + "total_code_suggestions": 132, + "total_code_acceptances": 67, + "total_code_lines_suggested": 154, + "total_code_lines_accepted": 72 + } + ] + } + ] + } + ] + }, + "copilot_ide_chat": { + "total_engaged_users": 13, + "editors": [ + { + "name": "vscode", + "total_engaged_users": 13, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 12, + "total_chats": 45, + "total_chat_insertion_events": 12, + "total_chat_copy_events": 16 + }, + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_engaged_users": 1, + "total_chats": 10, + "total_chat_insertion_events": 11, + "total_chat_copy_events": 3 + } + ] + } + ] + }, + "copilot_dotcom_chat": { + "total_engaged_users": 14, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_engaged_users": 14, + "total_chats": 38 + } + ] + }, + "copilot_dotcom_pull_requests": { + "total_engaged_users": 12, + "repositories": [ + { + "name": "demo/repo1", + "total_engaged_users": 8, + "models": [ + { + "name": "default", + "is_custom_model": false, + "custom_model_training_date": null, + "total_pr_summaries_created": 6, + "total_engaged_users": 8 + } + ] + }, + { + "name": "demo/repo2", + "total_engaged_users": 4, + "models": [ + { + "name": "a-custom-model", + "is_custom_model": true, + "custom_model_training_date": "2024-02-01", + "total_pr_summaries_created": 10, + "total_engaged_users": 4 + } + ] + } + ] + } + } + ], + "schema": { + "type": "array", + "items": { + "title": "Copilot Usage Metrics", + "description": "Copilot usage metrics for a given day.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "description": "The date for which the usage metrics are aggregated, in `YYYY-MM-DD` format." + }, + "total_active_users": { + "type": "integer", + "description": "The total number of Copilot users with activity belonging to any Copilot feature, globally, for the given day. Includes passive activity such as receiving a code suggestion, as well as engagement activity such as accepting a code suggestion or prompting chat. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "total_engaged_users": { + "type": "integer", + "description": "The total number of Copilot users who engaged with any Copilot feature, for the given day. Examples include but are not limited to accepting a code suggestion, prompting Copilot chat, or triggering a PR Summary. Does not include authentication events. Is not limited to the individual features detailed on the endpoint." + }, + "copilot_ide_code_completions": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot editor code completions in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code suggestion, across all active editors. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given language. Includes both full and partial acceptances." + } + } + } + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot code completion metrics for active editors.", + "additionalProperties": true, + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor. Includes both full and partial acceptances." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language and model. Includes both full and partial acceptances." + }, + "languages": { + "type": "array", + "description": "Code completion metrics for active languages, for the given editor.", + "items": { + "type": "object", + "description": "Usage metrics for a given language for the given editor for Copilot code completions.", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "Number of users who accepted at least one Copilot code completion suggestion for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_suggestions": { + "type": "integer", + "description": "The number of Copilot code suggestions generated for the given editor, for the given language." + }, + "total_code_acceptances": { + "type": "integer", + "description": "The number of Copilot code suggestions accepted for the given editor, for the given language. Includes both full and partial acceptances." + }, + "total_code_lines_suggested": { + "type": "integer", + "description": "The number of lines of code suggested by Copilot code completions for the given editor, for the given language." + }, + "total_code_lines_accepted": { + "type": "integer", + "description": "The number of lines of code accepted from Copilot code suggestions for the given editor, for the given language." + } + } + } + } + } + } + } + } + } + } + } + }, + "copilot_ide_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in the IDE.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat in the IDE." + }, + "editors": { + "type": "array", + "items": { + "type": "object", + "description": "Copilot Chat metrics, for active editors.", + "properties": { + "name": { + "type": "string", + "description": "Name of the given editor." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the specified editor." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who prompted Copilot Chat in the given editor and model." + }, + "total_chats": { + "type": "integer", + "description": "The total number of chats initiated by users in the given editor and model." + }, + "total_chat_insertion_events": { + "type": "integer", + "description": "The number of times users accepted a code suggestion from Copilot Chat using the 'Insert Code' UI element, for the given editor." + }, + "total_chat_copy_events": { + "type": "integer", + "description": "The number of times users copied a code suggestion from Copilot Chat using the keyboard, or the 'Copy' UI element, for the given editor." + } + } + } + } + } + } + } + } + }, + "copilot_dotcom_chat": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot Chat in github.com", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once." + }, + "models": { + "type": "array", + "description": "List of model metrics for a custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model (if applicable)." + }, + "total_engaged_users": { + "type": "integer", + "description": "Total number of users who prompted Copilot Chat on github.com at least once for each model." + }, + "total_chats": { + "type": "integer", + "description": "Total number of chats initiated by users on github.com." + } + } + } + } + } + }, + "copilot_dotcom_pull_requests": { + "type": [ + "object", + "null" + ], + "description": "Usage metrics for Copilot for pull requests.", + "additionalProperties": true, + "properties": { + "total_engaged_users": { + "type": "integer", + "description": "The number of users who used Copilot for Pull Requests on github.com to generate a pull request summary at least once." + }, + "repositories": { + "type": "array", + "description": "Repositories in which users used Copilot for Pull Requests to generate pull request summaries", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name" + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository." + }, + "models": { + "type": "array", + "description": "List of model metrics for custom models and the default model.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the language used for Copilot code completion suggestions, for the given editor." + }, + "is_custom_model": { + "type": "boolean", + "description": "Indicates whether a model is custom or default." + }, + "custom_model_training_date": { + "type": [ + "string", + "null" + ], + "description": "The training date for the custom model." + }, + "total_pr_summaries_created": { + "type": "integer", + "description": "The number of pull request summaries generated using Copilot for Pull Requests in the given repository." + }, + "total_engaged_users": { + "type": "integer", + "description": "The number of users who generated pull request summaries using Copilot for Pull Requests in the given repository and model." + } + } + } + } + } + } + } + } + } + }, + "required": [ + "date" + ], + "additionalProperties": true + } + } + } + } + ], + "previews": [], + "descriptionHTML": "

Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.

\n

Note

\n

\nThis endpoint will only return results for a given day if the team had five or more members with active Copilot licenses on that day, as evaluated at the end of that day.

\n
\n

The response contains metrics for up to 28 days prior. Metrics are processed once per day for the previous day,\nand the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,\nthey must have telemetry enabled in their IDE.

\n

To access this endpoint, the Copilot Metrics API access policy must be enabled for the organization containing the team within GitHub settings.\nOnly organization owners for the organization that contains this team and owners and billing managers of the parent enterprise can view Copilot metrics for a team.

\n

OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot, read:org, or read:enterprise scopes to use this endpoint.

", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "

OK

" + }, + { + "httpStatusCode": "403", + "description": "

Forbidden

" + }, + { + "httpStatusCode": "404", + "description": "

Resource not found

" + }, + { + "httpStatusCode": "422", + "description": "

Copilot Usage Merics API setting is disabled at the organization or enterprise level.

" + }, + { + "httpStatusCode": "500", + "description": "

Internal Error

" + } + ] + } + ], "copilot-usage": [ { "serverUrl": "https://api.github.com", @@ -374750,7 +377094,7 @@ } ], "previews": [], - "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

", + "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

\n

Note

\n

\nRequests using a fine-grained access token will receive a 200 Success response with an empty list.

\n
", "statusCodes": [ { "httpStatusCode": "200", diff --git a/src/rest/data/ghes-3.10-2022-11-28/schema.json b/src/rest/data/ghes-3.10-2022-11-28/schema.json index 3cba0ced3cd1..0078d352826a 100644 --- a/src/rest/data/ghes-3.10-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.10-2022-11-28/schema.json @@ -322714,7 +322714,7 @@ } ], "previews": [], - "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

", + "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

\n

Note

\n

\nRequests using a fine-grained access token will receive a 200 Success response with an empty list.

\n
", "statusCodes": [ { "httpStatusCode": "200", diff --git a/src/rest/data/ghes-3.11-2022-11-28/schema.json b/src/rest/data/ghes-3.11-2022-11-28/schema.json index 1e9aad00e50a..44c3e91d4fce 100644 --- a/src/rest/data/ghes-3.11-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.11-2022-11-28/schema.json @@ -322985,7 +322985,7 @@ } ], "previews": [], - "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

", + "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

\n

Note

\n

\nRequests using a fine-grained access token will receive a 200 Success response with an empty list.

\n
", "statusCodes": [ { "httpStatusCode": "200", diff --git a/src/rest/data/ghes-3.12-2022-11-28/schema.json b/src/rest/data/ghes-3.12-2022-11-28/schema.json index 72fd57200a94..bf6169358fc3 100644 --- a/src/rest/data/ghes-3.12-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.12-2022-11-28/schema.json @@ -325375,7 +325375,7 @@ } ], "previews": [], - "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

", + "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

\n

Note

\n

\nRequests using a fine-grained access token will receive a 200 Success response with an empty list.

\n
", "statusCodes": [ { "httpStatusCode": "200", diff --git a/src/rest/data/ghes-3.13-2022-11-28/schema.json b/src/rest/data/ghes-3.13-2022-11-28/schema.json index d53cdebfe375..ebaf51ac9634 100644 --- a/src/rest/data/ghes-3.13-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.13-2022-11-28/schema.json @@ -325657,7 +325657,7 @@ } ], "previews": [], - "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

", + "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

\n

Note

\n

\nRequests using a fine-grained access token will receive a 200 Success response with an empty list.

\n
", "statusCodes": [ { "httpStatusCode": "200", diff --git a/src/rest/data/ghes-3.14-2022-11-28/schema.json b/src/rest/data/ghes-3.14-2022-11-28/schema.json index add3e2d86ad4..1446bcc76975 100644 --- a/src/rest/data/ghes-3.14-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.14-2022-11-28/schema.json @@ -325669,7 +325669,7 @@ } ], "previews": [], - "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

", + "descriptionHTML": "

List organizations for the authenticated user.

\n

For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with read:org scope, you can publicize your organization membership with user scope, etc.). Therefore, this API requires at least user or read:org scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a 403 Forbidden response.

\n

Note

\n

\nRequests using a fine-grained access token will receive a 200 Success response with an empty list.

\n
", "statusCodes": [ { "httpStatusCode": "200", diff --git a/src/rest/lib/config.json b/src/rest/lib/config.json index e6cf89353a91..72cc8a818571 100644 --- a/src/rest/lib/config.json +++ b/src/rest/lib/config.json @@ -47,5 +47,5 @@ ] } }, - "sha": "7c6cc4ee9c2354d4093640bec365415ddd1c3506" + "sha": "c8e5a99583a3fd250dada63a4a9f5c4fffc53409" } \ No newline at end of file diff --git a/src/webhooks/lib/config.json b/src/webhooks/lib/config.json index 43cd78c994e7..4c3c2616a564 100644 --- a/src/webhooks/lib/config.json +++ b/src/webhooks/lib/config.json @@ -1,3 +1,3 @@ { - "sha": "7c6cc4ee9c2354d4093640bec365415ddd1c3506" + "sha": "c8e5a99583a3fd250dada63a4a9f5c4fffc53409" } \ No newline at end of file