API Reference
Log In
API Reference

Get PRs by department, per day

Returns a daily merged pull request series for your team (GitHub and GitLab combined), for the whole startDate to endDate range in one call. Without groupBy, returns the team's daily total (one row per UTC calendar day). With groupBy=department, returns one row per day and department. Each merged PR counts toward the department the author belonged to on the day it merged (primary department only), so a department transfer in the middle of the range splits correctly by day. Totals match GET /v2/api/billing/users/vcs-prs for the same dates. Authors who do not belong to any department are grouped under departmentId=null, departmentName="Unassigned" rather than dropped, so grouped totals still add up to the ungrouped total. departmentId limits the result to that department's subtree (includeDescendants=true) or that department alone (false, the default); the Unassigned group is excluded whenever departmentId is set. At most 35 days per request. The response has no commits field. teamId names the team to read, as on every PR Health endpoint; without it, the API key's team is used, else the signed-in user's first team.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
date
required

Start date (ISO yyyy-MM-dd)

date
required

End date (ISO yyyy-MM-dd)

string

When set to 'department', returns one row per (day, department) instead of the plain daily total. Only 'department' is supported.

int64

Scope the result to a single department (and, with includeDescendants, its subtree). Must belong to the resolved team (teamId, else the caller's organization).

boolean
Defaults to false

When departmentId is set, also include its descendant departments. Ignored when departmentId is omitted.

string

Team to read or write, as the team's hashid (the same id as /v2/api/teams/{id}). The caller must belong to it or be able to read it: 403 otherwise, 404 when no such team exists. An API key may only name its own organization. Omit it for the API key's organization, or for a signed-in user the first organization they belong to.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*