View all connectors

GitHub Copilot Metrics (Enterprise)

By enabling the GitHub Copilot connector, you can import user-level Copilot usage metrics. Please refer to the API documentation below and our schema explorer to see what data DX imports—note that DX does not read or access your source code.

Before proceeding, please make sure that you have first enabled the GitHub connector by following the steps here. Each GitHub-related connection in DX should utilize a separate GitHub App or API token to avoid rate limit issues.

Prerequisites

To connect GitHub Commits to DX, you need:

Setup instructions

Follow the steps below to connect GitHub to DX.

Step 1

While signed into GitHub as an Enterprise Owner, navigate to Settings > Developer Settings > Personal Access Token.

Step 2

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

Step 3

  • Navigate to the connections page in DX and select “+ Connection” in the top right.
  • 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. Please note that, to access these API endpoint, your Copilot Metrics API access policy must be enabled or set to “no policy” for your enterprise.

Endpoint Reference
/enterprises/{enterprise}/copilot/billing/seats Link
/enterprises/{enterprise}/copilot/metrics Link
/enterprises/{enterprise}/copilot/user-engagement Link

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 use 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—not your organization name—and use your Personal Access Token in the Authorization header.

Copilot has been connected but all of my reports are blank

This indicates that a Copilot metrics API access policy has not yet been enabled for your enterprise.