Metrics Endpoint Structure
All metrics endpoints follow the same base structure: Endpoint:POST /metrics/v2/{metric_type}
Authentication Required: Yes
Path Parameters:
metric_type(string, required): The type of metric to retrieve. See available metric types below.
Common Request Parameters
Most metric endpoints accept the following request parameters:Parameter Details
Key-value pairs for filtering the metric data. Common filters include:
repository_id: Filter by specific repositoryuser_id: Filter by specific userteam_id: Filter by specific teamstart_date: Start date for the metric calculationend_date: End date for the metric calculation
Fields to group the results by. Default:
[]Common grouping fields include:repository_name: Group by repositoryuser_name: Group by userteam_name: Group by team
Time granularity for data aggregation. Options:
day: Daily aggregationweek: Weekly aggregationmonth: Monthly aggregationquarter: Quarterly aggregationyear: Yearly aggregation
Method to aggregate the metric data. Options depend on the metric type but generally include:
sum: Sum valuesavg: Average valuescount: Count occurrencesmin: Minimum valuemax: Maximum valuemedian: Median valuep90: 90th percentile
Minimum value threshold for the metric. Default:
0Date field to use for time-based calculations. Options depend on the metric type but generally include:
created_at: Creation datemerged_at: Merge datecompleted_at: Completion date
Whether to return data formatted for time series visualization. Default:
falseWhether to include data from the previous time period for comparison. Default:
falseResponse Format
The response format depends on the requested metric and parameters. By default, the API returns a JSON object with the requested metric data:time_series_data is set to true, the response will be formatted for line chart visualization:
Available Metric Types
The API provides a wide range of metric types across several categories:- Development Metrics
- Pull Request Metrics
- Issue Metrics
- Other Metrics
coding-time: Time spent codingcommit-to-open: Time from commit to PR openreviews-count: Number of reviewsopen-to-review: Time between PR open and first reviewreview-to-merge: Time between first review and mergereview-time: Total time spent in reviewrework-time: Time spent on rework after reviewcycle-time: Full cycle time from commit to merge

