latestOpenAPI 3.1.02026-08-1031319.3 KB

68d401c79425

Built-in reports

Code metrics overview

Overview of pull request metrics per team, mirroring the Code metrics — Overview report in the app. Returns one row per matched team plus a summaryRow aggregating across all of them.

Durations (cycleTime, timeToFirstReview, mergeTime) are in seconds. reviewRate is a percentage (0–100). The numeric aggregate parameter controls how the duration and batch-size metrics are aggregated.

Supported revisions: 1, 2 (latest is equivalent to 2). Revision 2 added the teamFte and mergedPrsByFte columns and treats teamId/parentTeamId as comma-separated lists. In revision 1, supplying teamId returns that team's child teams only (the team itself is excluded from rows but still counted in summaryRow).

get/reports/metrics/code

Query parameters

output'json' | 'csv'

Response format.

revisionstring required

Report revision to serve. Use latest to request the highest supported revision for this report. The served revision is echoed in the X-Swarmia-Report-Revision response header.

The deprecated version query parameter is accepted as an alias.

timeframe.startstring date required

Start of the reporting period (inclusive).

timeframe.endstring date required

End of the reporting period (inclusive).

timezonestring

IANA timezone used to interpret the date-only timeframe.start and timeframe.end values and for time bucketing. Defaults to UTC.

teamIdstring

Comma-separated team UUIDs. Only these teams are included. Use either this or parentTeamId, not both. Omit both to return all teams.

parentTeamIdstring

Comma-separated parent-team UUIDs. Returns the children of these teams (not the parents themselves). Use the literal value null (or an empty value) to select only top-level teams (teams with no parent). Use either this or teamId, not both. Omit both to return all teams.

aggregate'Sum' | 'Avg' | 'Min' | 'Max' | 'P99' | 'P95' | 'P90' | 'P85' | 'P80' | 'P75' | 'P50'

Numeric aggregation applied to the metrics. Affects every metric whose schema entry reports a configurable aggregate (e.g. cycleTime, changeLeadTimeAgg). Metrics with a fixed aggregate (counts, rates) are unaffected. Defaults to Avg.

pullRequestFilterstring

Aggregate data only from pull requests matching the given filter. Uses the same entity-filter format as the Swarmia UI's similarly named query parameter.

Response

Successful response.

schemaobject required

Describes each property in rows. Keys are property names, values carry a human-readable title, description and the aggregate used.