Skip to main content

Documentation Index

Fetch the complete documentation index at: https://bilanc.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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).
Authorization: YOUR_API_KEY
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:
{
  "filters": {
    "start_date": "2024-01-01",
    "end_date": "2024-01-31",
    "member": ["user-id-1"],
    "team": ["team-id-1"],
    "repositories": [{"repository_name": "my-repo"}]
  },
  "group_by": ["team_name", "repository_name"],
  "date_level": "day|week|month|quarter|year",
  "aggregation": "SUM|AVG|MIN|MAX",
  "metric_min_value": 0,
  "date_field": "created_at|merged_at|completed_at",
  "time_series_data": false,
  "include_previous_period": false,
  "order_by": "team_name",
  "order_direction": "ASC",
  "limit": 50
}

Parameter Details

filters
object
required
Object containing all filter criteria. start_date is required for most metrics.
FilterTypeDescription
start_datestringStart of the date range (ISO 8601, e.g. 2024-01-01)
end_datestringEnd of the date range. Defaults to today if omitted
memberstring[]Filter by author/contributor user IDs
teamstring[]Filter by team IDs
squad_idsstring[]Filter by squad IDs
squad_levelsinteger[]Filter by squad hierarchy level
repositoriesobject[]Array of {"repository_name": "..."} objects
departmentsstring[]Filter by department names
manager_idsstring[]Filter by manager user IDs
manager_emailstringFilter by a single manager’s email
pr_statesstring[]PR states: open, closed, merged
pr_categoriesstring[]PR category classifications
pull_requests_search_termstringFull-text search across PR title, description, body, summary, and category
sourcesstring[]VCS source: github, gitlab, bitbucket
branchesstring[]Filter by git branch names
ticket_statusstring[]Issue states: completed, started, backlog, etc.
issue_idsstring[]Filter by specific issue IDs
project_idsstring[]Filter by project IDs
workflow_run_idsstring[]Filter by GitHub Actions workflow run IDs
workflow_namesstring[]Filter by workflow names
run_conclusionsstring[]Workflow conclusions: success, failure, cancelled, etc.
ai_copilot_sourcesstring[]Filter by AI copilot source
locationsstring[]Filter by employee location
levelsstring[]Filter by employee level
group_by
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
date_level
string
Time granularity for aggregation. Options: day, week, month, quarter, year. Omit to return a single aggregate row.
aggregation
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.
metric_min_value
number
Exclude rows where the metric value is below this threshold. Default: 0.
date_field
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.
time_series_data
boolean
When true, returns data formatted for chart libraries (series + categories). Default: false.
include_previous_period
boolean
When true, includes the equivalent previous period for comparison. Results include a previous_* field alongside the current value. Default: false.
order_by
string
Field name to sort results by.
order_direction
string
Sort direction: ASC or DESC. Default: ASC.
limit
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:
{
  "results": [
    {
      "metric_name": "pull-requests-count",
      "value": 42,
      "group_by": {
        "repository_name": "my-repository"
      }
    },
    {
      "metric_name": "pull-requests-count",
      "value": 18,
      "group_by": {
        "repository_name": "another-repository"
      }
    }
  ],
  "meta": {
    "filters": {
      "start_date": "2023-01-01",
      "end_date": "2023-12-31"
    },
    "date_range": {
      "start_date": "2023-01-01",
      "end_date": "2023-12-31"
    }
  }
}
If time_series_data is set to true, the response will be formatted for line chart visualization:
{
  "series": [
    {
      "name": "my-repository",
      "data": [4, 8, 12, 10, 8]
    },
    {
      "name": "another-repository",
      "data": [2, 4, 5, 4, 3]
    }
  ],
  "categories": ["Jan 2023", "Feb 2023", "Mar 2023", "Apr 2023", "May 2023"],
  "meta": {
    "filters": {
      "start_date": "2023-01-01",
      "end_date": "2023-05-31"
    },
    "date_range": {
      "start_date": "2023-01-01",
      "end_date": "2023-05-31"
    }
  }
}

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