Sunday, December 6, 2026

News · AI coding

Copilot usage metrics API now shows pull requests per user: the 7 fields and how to query them

Since 4 December the API's user reports carry a pull_requests object: PRs created, reviewed and merged, and how much Copilot did. Two commands pull it; four quirks skew the totals.

The short version

  • Since 4 December 2026, every user row in the 1-day and 28-day Copilot user reports has a pull_requests object.
  • It has 7 fields: PRs created, reviewed and merged per user, each with the share made or reviewed by Copilot.
  • Two calls get it: the report endpoint returns signed download links, then you fetch the files; you can request days from the last year only.
  • The API costs nothing extra, but it's for orgs and enterprises with Copilot seats, such as Copilot Business ($19 a seat) or Enterprise ($39).

Prices, checked daily GitHub Copilot pricing

In this article · 5 sections
  1. 01The 7 new fields
  2. 02Who can read it, and what it costs
  3. 03How to query it
  4. 044 counting rules that skew the totals
  5. 05What to do with it
Ink illustration of a reviewer's desk lamp over stacked pull request cards, with the numbers 7 fields, 28 days and $19 a seat
Art: FLUX.2 Pro via the Black Forest Labs API. The text on the card is set by us, not generated.

GitHub's Copilot usage metrics API now tells you, per person and per day, how many pull requests each developer opened, reviewed and got merged, and how many of those Copilot wrote or reviewed. The change landed on 4 December 2026: every row in the user-level 1-day and 28-day reports now carries a pull_requests object. Before, PR numbers existed only for the whole org, the enterprise or a repository.

It's for organizations and enterprises with Copilot seats, such as Copilot Business or Enterprise. The API itself costs nothing extra. Below: the seven fields, two commands to pull them, and the counting rules that make per-user sums disagree with the org totals.

The 7 new fields

Each user row gets a pull_requests object with these counts for that day, as GitHub's changelog defines them:

Field What it counts
total_created PRs the user created, including PRs Copilot cloud agent made for a session the user started
total_created_by_copilot The part of total_created made by Copilot cloud agent
total_reviewed PRs the user reviewed, not counting their own
total_reviewed_by_copilot The user's own PRs that Copilot code review reviewed
total_merged The user's PRs merged that day
total_merged_created_by_copilot The part of total_merged made by Copilot cloud agent
total_merged_reviewed_by_copilot The part of total_merged reviewed by Copilot code review

Note the direction of total_reviewed_by_copilot: it counts the user's PRs that Copilot reviewed, not reviews the user asked Copilot to do on someone else's work. The object sits next to the fields the user record already had, such as user_login, user_id, day, ai_credits_used and the lines-of-code sums, according to the example schema.

Who can read it, and what it costs

According to the REST docs, these people can read it:

  • Organization reports: org owners, or anyone with a custom role that has "View Organization Copilot Metrics". Classic tokens need the read:org scope.
  • Enterprise reports: enterprise owners, billing managers, or a custom role with "View Enterprise Copilot Metrics". Classic tokens need manage_billing:copilot or read:enterprise.
  • The Copilot usage metrics policy must be enabled. For enterprise endpoints, the docs say "Enabled everywhere".

Calling the API is free. What you pay for is the seats: Copilot Business is $19 per granted seat per month and Enterprise is $39, per GitHub's plans page (checked 5 December 2026). The same page lists a Copilot access option for eligible enterprises ($0 per user with a GitHub Enterprise Cloud license, $10 a user a month standalone) with the same features as Copilot Enterprise. The metrics reference says the dashboards are at enterprise and organization level, so the individual plans (Free, Student, Pro, Pro+, Max) don't get usage metrics.

One naming trap: searches for "Copilot usage reports Graph API" usually mean Microsoft 365 Copilot, which reports through Microsoft Graph. That is a different product. Everything here is GitHub Copilot.

How to query it

The report endpoints don't return the data itself. They return download_links, signed URLs that expire after a short time, and you fetch the files from those. The organization endpoints are:

Endpoint What you get
GET /orgs/{org}/copilot/metrics/reports/users-1-day?day=YYYY-MM-DD One day, one row per user
GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest The latest 28 days ending on the last processed day

The enterprise versions use /enterprises/{enterprise}/copilot/metrics/reports/ with the same report names. The docs list API version 2026-03-10. The docs for the enterprise reports say reports exist from 10 October 2025, but historical data can be requested for up to one year back from the current date. The changelog doesn't say whether the PR fields were filled in for days before 4 December 2026.

With the GitHub CLI signed in under an account that has access, fetching the 28-day user report takes one command (replace your-org):

gh api -H "X-GitHub-Api-Version: 2026-03-10" \
  /orgs/your-org/copilot/metrics/reports/users-28-day/latest \
  --jq '.download_links[]' |
while read -r url; do curl -sL "$url"; done > users-28-day.json

The signed links don't need your token, so plain curl is enough. GitHub documents the exports as NDJSON (one record per line), but its user example is shown as a JSON array. The jq filter below accepts both. It adds up the PR counts per person over the period, largest number of merges first:

jq -n '[inputs | if type == "array" then .[] else . end]
  | group_by(.user_login)
  | map({
      user: .[0].user_login,
      created: (map(.pull_requests.total_created // 0) | add),
      created_by_copilot: (map(.pull_requests.total_created_by_copilot // 0) | add),
      merged: (map(.pull_requests.total_merged // 0) | add),
      merged_reviewed_by_copilot: (map(.pull_requests.total_merged_reviewed_by_copilot // 0) | add),
      reviewed: (map(.pull_requests.total_reviewed // 0) | add)
    })
  | sort_by(-.merged)' users-28-day.json

We wrote these commands from GitHub's published endpoints and schema. We don't have a Copilot Business org to run them against, so check the first output by hand against a few PRs you know. If a 28-day file holds one summary row per user instead of one per day, the grouping still works: each group just has one row.

4 counting rules that skew the totals

The changelog lists rules that will catch anyone who adds up the user rows and compares them with the org report:

  1. Users appear only on days they used Copilot. A developer who merged three PRs on a day without touching Copilot isn't in that day's file at all. User totals measure Copilot users' activity, not your whole team's.
  2. Bot PRs don't go to any user, except those from Copilot cloud agent. PRs from Dependabot or other bots count in the org or enterprise totals but not in the user totals, so the user sum comes out lower.
  3. Reviews count once per reviewer. A PR with two reviewers counts for both, so the summed total_reviewed can be higher than the aggregate.
  4. No time to merge per user. Median time to merge is only in the enterprise, organization and repository reports.

Rows for users who used Copilot but did nothing with PRs that day show zeros, not missing fields. The // 0 in the filter above covers older files where the object doesn't exist yet.

What to do with it

The useful comparison is inside one team over time: is the share of merged PRs that came from Copilot cloud agent (total_merged_created_by_copilot / total_merged) going up, and are those PRs getting merged or left open? If you're deciding how much Copilot code review to buy, total_merged_reviewed_by_copilot shows how much of the merged work it already touches. Our breakdown of Copilot code review's new tiers covers what each review costs.

Treat the numbers as signals, not a leaderboard. PR counts per person reward splitting work into small PRs, and rule 1 above leaves out every day someone worked without Copilot. GitHub's own metrics reference says the dashboard's return-on-investment figures should be read as estimates, and the same caution fits here.

Related on Smarter Than Us: Copilot in VS Code, November 2026.