Skip to main content

Metrics Endpoint Structure

All metrics endpoints follow the same base structure: Endpoint: POST /metrics/{metric_type} Authentication Required: Yes — API key passed directly in the Authorization header (no Bearer prefix).
You can generate an API key from your Bilanc dashboard under Settings → API Keys. 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

object
required
Object containing all filter criteria. start_date is required for most metrics.
string[]
Fields to group results by. Default: []Common values: team_name, team_id, repository_name, name (author), manager_name, department, squad_name, squad_level, role
string
Time granularity for aggregation. Options: day, week, month, quarter, year. Omit to return a single aggregate row.
string
Aggregation method. Required for non-count metrics. Options: SUM, AVG, MIN, MAX. Count-based metrics (e.g. pull-requests-count, issues-count) do not require this field.
number
Exclude rows where the metric value is below this threshold. Default: 0.
string
Which date column to use for time-based filtering and grouping. Available values depend on the metric — see each metric page for valid options.
boolean
When true, returns data formatted for chart libraries (series + categories). Default: false.
boolean
When true, includes the equivalent previous period for comparison. Results include a previous_* field alongside the current value. Default: false.
string
Field name to sort results by.
string
Sort direction: ASC or DESC. Default: ASC.
integer
Maximum number of rows to return (1–200).

Response Format

The response format depends on the requested metric and parameters. By default, the API returns a JSON object with the requested metric data:
If 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:
  • coding-time: Time spent coding
  • pickup-time: Time between commit and PR open
  • commit-to-open: Time from commit to PR open
  • open-to-review: Time between PR open and first review
  • review-to-merge: Time between first review and merge
  • review-time: Total time spent in review
  • rework-time: Time spent on rework after review
  • cycle-time: Full cycle time from commit to merge
  • time-to-first-comment: Time to the first comment on a PR
  • rework-rate: Rate of rework after review
  • complexity-score: Code complexity score
  • contributors-count: Number of unique contributors