Returns open and closed-unmerged pull request counts per engineer, with an average AI cost per pull request (USD) you can multiply to estimate cost. Open-PR figures reflect the current synced state within the team's cutoff; closed-without-merge counts, merged counts and the cost basis are scoped to [startDate, endDate]. Team settings from /v2/api/teams/{id}/settings/pr-health apply to every figure: pull requests opened (by creation time, UTC) before cutoffDate are left out, whether open or closed; excluded repositories are left out (matched case-insensitively); automation, meaning declared bot authors plus titles or author logins matching the built-in or custom automation patterns, is left out of every figure and list. departmentId narrows every figure to the department's members as of today (404 when the department is not the caller's). totals.automationPrs counts the open automation pull requests, drafts included, and the *Assisted totals count the AI-assisted subset of each figure. causes[] counts the open pull requests per action-queue cause (see GET /vcs-pr-health/queue for the rules), always all seven in queue order; the causes other than AUTOMATION add up to openPrs + draftPrs, AUTOMATION equals automationPrs, and prsAssisted is the AI-assisted subset (for AUTOMATION it equals prs). engineers[].mergedPrs counts each engineer's merges in the window under the same settings and department as closedUnmerged, so the two form a like-for-like rot rate; mergedPrsAssisted is the AI-assisted subset under the same rule. Both are 0, never null, when the engineer merged nothing in scope. cutoffDate, cutoffDateIsDefault and excludedRepos echo the settings applied; cutoffDate is the team's own date only, null when it has none; countsSince is where counts start: cutoffDate, else six months before today (UTC). pricedSince is where dollar estimates start: cutoffDate, else the organization's first coding-assistant day, else null. totals.pricedRottingPrs, pricedRottingPrsAssisted, pricedClosedUnmerged and pricedClosedUnmergedAssisted, and causes[].pricedPrs and pricedPrsAssisted, are the same figures cut to pull requests opened on or after pricedSince: price those, never the full counts. departmentId and includeDescendants echo the request and are null when it is unscoped. An open pull request the team dismissed, or snoozed until a date after today (UTC), leaves every open figure, engineers[], oldest and causes[], and totals.triagedPrs counts those human pull requests instead (drafts included; see POST /vcs-pr-health/triage/dismiss). Automation ignores dismissals, closed and merged figures never change, and totals.triagedPrs is always present. Aging and rotting classify by INACTIVITY (days since the PR's last provider-side activity) against the org's thresholds, not by age alone; rows also carry ageDays, lastCommitAtVcs, and reviewDecision. reviewDecision is APPROVED when a reviewer with write access has approved and none of them has an outstanding change request, CHANGES_REQUESTED when one of them does, and absent either when none of them has left a verdict or when the provider answered for fewer reviewers than the pull request has, which leaves an approval unconfirmed; it says nothing about whether the repository's branch protection is satisfied. Draft PRs are counted separately and excluded from aging/rotting. Multiply a count by avgCostPerMergedPr to estimate dollars (a team-wide average, so the result is only an estimate); at-risk (rotting) and wasted (closed unmerged) stay separate figures. avgCostPerMergedPr divides the organization's coding-assistant completion cost in the window (Claude Code, Codex, Cowork, Cursor, Gemini CLI and Copilot calls; AI traffic metered through your own products is not counted) by every pull request in it, automation excluded: open at the window's end (drafts and dismissed or snoozed pull requests aside), closed without merging in the window, or merged in it, each opened on or after the organization's first coding-assistant day (earlier pull requests share no spend). The name avgCostPerMergedPr predates this rule. The team's own cutoff, the exclusions and departmentId do not narrow it. engineers[] carry pricedRottingPrs and pricedClosedUnmerged under the same rule as the priced totals. It counts every coding assistant call, including usage your team buys on a subscription, so it answers what the work was worth rather than what was billed per call. If your team treats any assistant as a seat subscription, this figure is therefore higher than the cost totals elsewhere in the API, which leave subscription assistants out. totals.basisMergedPrs and totals.aiWorkValue are its denominator and numerator, always present (0 pull requests or no recorded coding-assistant spend leave avgCostPerMergedPr absent; it is never 0), and totals.basisOpenPrs, always present, is the part of basisMergedPrs open at the window's end. Thresholds come from the team settings endpoint (/v2/api/teams/{id}/settings/pr-health) and are echoed here. The window may span at most 366 days counting both startDate and endDate (for example 2024-01-01 to 2025-01-01, so a one-year window that crosses 29 February is one day too wide), and startDate must not be after endDate; either violation is a 400.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||