Конечные точки REST API для метрик использования Copilot
Используйте REST API для просмотра Copilot метрик использования.
Get Copilot enterprise usage metrics for a specific day
Use this endpoint to retrieve download links for the Copilot enterprise usage metrics report for a specific day. The report provides comprehensive usage data for Copilot features across the enterprise.
The report contains aggregated metrics for the specified day, 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 of the report. The report covers a complete day for which data has been processed. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date.
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.
Подробные маркеры доступа для "Get Copilot enterprise usage metrics for a specific day
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Enterprise Copilot metrics" enterprise permissions (read)
Параметры для "Get Copilot enterprise usage metrics for a specific day"
| Имя., Тип, Description |
|---|
accept string Setting to |
| Имя., Тип, Description |
|---|
enterprise string Обязательное полеThe slug version of the enterprise name. |
| Имя., Тип, Description |
|---|
day string Обязательное полеThe day to request data for, in |
Коды состояния http-ответа для "Get Copilot enterprise usage metrics for a specific day"
| Код состояния | Description |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Примеры кода для "Get Copilot enterprise usage metrics for a specific day"
Если вы обращаетесь к GitHub в GHE.com, заменитеapi.github.com выделенный поддоменapi.SUBDOMAIN.ghe.comпредприятия.
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/enterprises/ENTERPRISE/copilot/metrics/reports/enterprise-1-day?day=DAY"Response
Status: 200{
"download_links": [
"https://example.com/copilot-usage-report-1.json",
"https://example.com/copilot-usage-report-2.json"
],
"report_day": "2025-07-01"
}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.
Подробные маркеры доступа для "Get Copilot enterprise usage metrics
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Enterprise Copilot metrics" enterprise permissions (read)
Параметры для "Get Copilot enterprise usage metrics"
| Имя., Тип, Description |
|---|
accept string Setting to |
| Имя., Тип, Description |
|---|
enterprise string Обязательное полеThe slug version of the enterprise name. |
Коды состояния http-ответа для "Get Copilot enterprise usage metrics"
| Код состояния | Description |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Примеры кода для "Get Copilot enterprise usage metrics"
Если вы обращаетесь к GitHub в GHE.com, заменитеapi.github.com выделенный поддоменapi.SUBDOMAIN.ghe.comпредприятия.
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/copilot/metrics/reports/enterprise-28-day/latestResponse
Status: 200{
"download_links": [
"https://example.com/copilot-usage-report-1.json",
"https://example.com/copilot-usage-report-2.json"
],
"report_start_day": "2025-07-01",
"report_end_day": "2025-07-28"
}Get Copilot users usage metrics for a specific day
Use this endpoint to retrieve download links for the Copilot user usage metrics report for a specific day. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise.
The report contains user-specific metrics for the specified day, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement.
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 of the report. The report covers a complete day for which data has been processed. Reports are available starting from October 10, 2025, and historical data can be accessed for up to 1 year from the current date.
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.
Подробные маркеры доступа для "Get Copilot users usage metrics for a specific day
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Enterprise Copilot metrics" enterprise permissions (read)
Параметры для "Get Copilot users usage metrics for a specific day"
| Имя., Тип, Description |
|---|
accept string Setting to |
| Имя., Тип, Description |
|---|
enterprise string Обязательное полеThe slug version of the enterprise name. |
| Имя., Тип, Description |
|---|
day string Обязательное полеThe day to request data for, in |
Коды состояния http-ответа для "Get Copilot users usage metrics for a specific day"
| Код состояния | Description |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Примеры кода для "Get Copilot users usage metrics for a specific day"
Если вы обращаетесь к GitHub в GHE.com, заменитеapi.github.com выделенный поддоменapi.SUBDOMAIN.ghe.comпредприятия.
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/enterprises/ENTERPRISE/copilot/metrics/reports/users-1-day?day=DAY"Response
Status: 200{
"download_links": [
"https://example.com/copilot-usage-report-1.json",
"https://example.com/copilot-usage-report-2.json"
],
"report_day": "2025-07-01"
}Get Copilot users usage metrics
Use this endpoint to retrieve download links for the latest 28-day enterprise users Copilot usage metrics report. The report provides detailed user-level usage data and engagement metrics for Copilot features across the enterprise.
The report contains user-specific metrics for the previous 28 days, including individual user engagement statistics, feature usage patterns, and adoption metrics broken down by user. This report allows authorized users to analyze Copilot usage at the user level to understand adoption patterns and identify opportunities for increased engagement.
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.
Подробные маркеры доступа для "Get Copilot users usage metrics
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Enterprise Copilot metrics" enterprise permissions (read)
Параметры для "Get Copilot users usage metrics"
| Имя., Тип, Description |
|---|
accept string Setting to |
| Имя., Тип, Description |
|---|
enterprise string Обязательное полеThe slug version of the enterprise name. |
Коды состояния http-ответа для "Get Copilot users usage metrics"
| Код состояния | Description |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
Примеры кода для "Get Copilot users usage metrics"
Если вы обращаетесь к GitHub в GHE.com, заменитеapi.github.com выделенный поддоменapi.SUBDOMAIN.ghe.comпредприятия.
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/copilot/metrics/reports/users-28-day/latestResponse
Status: 200{
"download_links": [
"https://example.com/copilot-usage-report-1.json",
"https://example.com/copilot-usage-report-2.json"
],
"report_start_day": "2025-07-01",
"report_end_day": "2025-07-28"
}