GitHub Copilot Repository Metrics API: Endpoints, curl Examples and Setup Checklist

GitHub Copilot repository-level usage metrics are now generally available. Organization and enterprise administrators can request a one-day report that shows, by repository, pull requests created or merged by Copilot coding agent and pull requests reviewed by Copilot code review. Use the copy-ready API examples below, then store the downloaded NDJSON before its signed links expire.

New endpoints

  • GET /orgs/{org}/copilot/metrics/reports/repos-1-day?day=YYYY-MM-DD
  • GET /enterprises/{enterprise}/copilot/metrics/reports/repos-1-day?day=YYYY-MM-DD

Quick setup checklist

  1. Enable the Copilot usage metrics policy.
  2. Use an account or token with permission to view Copilot metrics.
  3. Choose a completed UTC day; GitHub says usage data can take up to two full days to become available.
  4. Call the organization or enterprise endpoint with the API version header.
  5. Download every URL returned in download_links while the signed links are still valid.
  6. Keep the original NDJSON and load a copy into your BI or reporting system.

Organization API example

Set the three variables, then run the request. Do not paste a real token into a shared script or commit it to a repository.

export GH_TOKEN="YOUR_TOKEN"
export ORG="YOUR_ORGANIZATION"
export DAY="2026-07-15"

curl --fail --silent --show-error --location \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GH_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  "https://api.github.com/orgs/$ORG/copilot/metrics/reports/repos-1-day?day=$DAY" \
  > "copilot-repos-$DAY-metadata.json"

The metadata response provides report information and one or more signed download links. Download and combine the NDJSON parts like this:

jq -r '.download_links[]' "copilot-repos-$DAY-metadata.json" |
while IFS= read -r url; do
  curl --fail --silent --show-error --location "$url"
done > "copilot-repos-$DAY.ndjson"

wc -l "copilot-repos-$DAY.ndjson"

Important: the URLs in download_links are temporary signed links. Archive the downloaded report, not the signed URLs. Also treat repository names and activity data as internal operational information.

Enterprise API example

Enterprise reporting uses the same flow but a different path:

export GH_TOKEN="YOUR_TOKEN"
export ENTERPRISE="YOUR_ENTERPRISE"
export DAY="2026-07-15"

curl --fail --silent --show-error --location \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GH_TOKEN" \
  -H "X-GitHub-Api-Version: 2026-03-10" \
  "https://api.github.com/enterprises/$ENTERPRISE/copilot/metrics/reports/repos-1-day?day=$DAY" \
  > "copilot-enterprise-repos-$DAY-metadata.json"

GitHub says enterprise owners and billing managers can access these reports, as can authorized users with a custom role granting the relevant Copilot metrics permission. Organization owners and appropriately authorized custom-role users can access organization reports.

What the repository report measures

According to GitHub’s July 17 announcement, the repository-level report includes:

  • pull requests created by Copilot coding agent;
  • pull requests merged from Copilot coding agent;
  • pull requests reviewed by Copilot code review; and
  • review suggestion counts broken down by comment type.

This is narrower than a complete software-delivery analytics system. It helps locate Copilot-assisted pull-request activity, but it does not by itself prove productivity, code quality, cost savings or developer satisfaction.

Safe first analysis

NDJSON contains one JSON object per line. Before writing a fixed query, inspect the keys in your downloaded report because schemas can evolve:

python3 - <<'PY'
import json
from pathlib import Path

path = Path("copilot-repos-2026-07-15.ndjson")
with path.open() as f:
    first = json.loads(next(f))

print("Fields:")
for key in sorted(first):
    print("-", key)
PY

For a useful dashboard, compare repositories using several signals rather than ranking teams by a single count:

  • Adoption: which repositories show recurring coding-agent or code-review activity?
  • Outcome: how many agent-created pull requests are eventually merged?
  • Review load: where is Copilot code review active, and what kinds of comments appear?
  • Context: repository size, release cadence, contributor count and pull-request volume.
  • Trend: a rolling weekly or monthly view built from daily reports.

A simple daily collection workflow

  1. Schedule collection after the documented processing delay, not immediately after midnight.
  2. Request the target day’s metadata.
  3. Fail the job on HTTP errors; do not save an error page as report data.
  4. Download all report parts.
  5. Validate that every non-empty line parses as JSON.
  6. Write the report to restricted storage using a date-based filename.
  7. Record collection time, report day and API version for auditability.

GitHub documentation says metric data is generally available within two full UTC days. If a very recent day is empty or unavailable, retry later instead of treating it as zero usage.

Companion update: Copilot app usage fields

GitHub also added Copilot app activity to organization and enterprise one-day and 28-day usage reports. The new top-level fields are:

  • daily_active_copilot_app_users — distinct users active in the Copilot app that day;
  • totals_by_copilot_app — session, request and prompt counts plus token-usage details.

GitHub notes that organizations or enterprises with no Copilot app activity receive null for these fields. Handle null explicitly rather than assuming an object is always present.

Common errors and fixes

403 Forbidden

Check that the Copilot usage metrics policy is enabled and the caller has the required organization or enterprise metrics permission. For classic tokens, consult the current GitHub documentation for the required scope; do not broaden permissions unless necessary.

404 Resource not found

Confirm the organization or enterprise slug, endpoint path and account access. GitHub may return 404 when the caller cannot see the requested resource.

No report for yesterday

Allow for GitHub’s processing window of up to two full UTC days. Use a completed day and retry after the data window has closed.

Download link expired

Call the API again to obtain fresh signed links, then immediately download all parts.

FAQ

Are GitHub Copilot repository metrics generally available?

Yes. GitHub announced general availability of daily repository-level Copilot usage reports on July 17, 2026 for organization and enterprise scopes.

Do repository metrics show code completion usage?

The new repository report described by GitHub focuses on pull-request activity from Copilot coding agent and Copilot code review. Use the broader Copilot usage reports for adoption, IDE, model, language and other engagement metrics.

How fresh is the data?

GitHub says Copilot usage metrics can take up to two full UTC days to become available.

Can I use these numbers to rank developers?

That is not a sound use of the data. Repository activity depends on team structure, repository type, pull-request volume and workflow design. Use the metrics to identify enablement opportunities and workflow trends, not as an isolated employee-performance score.

Sources

Last checked: July 18, 2026. API behavior, fields and permissions can change; verify the current GitHub documentation before production deployment.

Leave a Comment

muddaser logo

Public Speaker, Softskills trainer and technology enthusiast

Contact

Muddaser Altaf

Social Address