Skip to main content
All CollectionsData connectors
GitHub Copilot Metrics (Enterprise)
GitHub Copilot Metrics (Enterprise)
Updated over 2 weeks ago

By enabling the GitHub Copilot Usage connector allows you to import data on usage of GitHub Copilot at the user level. Please refer to the API documentation below for more details, and visit our schema explorer to see what data DX imports.

Prerequisites

To connect GitHub to DX, you need:

Setup instructions

Follow the steps below to connect GitHub to DX.

Step 1

Navigate to Settings -> Developer Settings -> Personal Access Token.

Step 2

Click on Token (classic) and generate new token (classic). Either the manage_billing:copilot or read:enterprise scope is required.

Step 3

  1. Navigate to the connector setup form in DX.

  2. Enter the credentials you have generated in the previous steps—refer to the information below for errors and troubleshooting.

API Reference

The table below lists the specific API endpoints that are used by DX.

Endpoint

Reference

/enterprises/ENTERPRISE/copilot/billing/seats

/enterprises/ENTERPRISE/copilot/metrics

Note: To access copilot/metrics endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings. Only enterprise owners and billing managers can view Copilot metrics for the enterprise.


Errors

The table below lists potential error codes when adding a connection in DX.

Error

Description

invalid_credentials

Your API credentials entered are not valid.

invalid_permissions

Your API token does not have the permissions required by DX—please verify that your service account is an Enterprise Owner.


Troubleshooting

I'm seeing "no_resource" error from API response

This indicates that you don’t have admin access to the enterprise account. To verify it’s working correctly, you can try the following curl request:

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/billing/seats

Replace ENTERPRISE with your enterprise slug and use your PAT in the Authorization header. Note that a Github organization is not an Enterprise.

Did this answer your question?