Sample - GitHub REST API
GET/enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest

Get Copilot enterprise usage metrics

Use this endpoint to retrieve download links for the latest 28-day enterprise Copilot usage metrics report. The report provides comprehensive usage data for Copilot features across the enterprise.

The report contains aggregated metrics for the previous 28 days, including usage statistics for various Copilot features, user engagement data, and feature adoption metrics. Reports are generated daily and made available for download through signed URLs with a limited expiration time.

The response includes download links to the report files, along with the specific date range covered by the report. The report covers a complete 28-day period ending on the most recent day for which data has been processed.

Enterprise owners, billing managers, and authorized users with fine-grained "View Enterprise Copilot Metrics" permission can retrieve Copilot metrics reports for the enterprise. OAuth app tokens and personal access tokens (classic) need either the manage_billing:copilot or read:enterprise scopes to use this endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter
enterprisestringrequired
The slug version of the enterprise name.

4 status codes
200Response
download_linksarray<string>required
The URLs to download the latest Copilot usage metrics report for the enterprise/organization.
report_start_daystringrequired
The start date of the report period in `YYYY-MM-DD` format.
report_end_daystringrequired
The end date of the report period in `YYYY-MM-DD` format.
403Forbidden
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
500Internal Error
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 403 is returned: Forbidden. A 404 is returned: Resource not found. A 500 is returned: Internal Error.