API Reference / Code - Repositories

Get branch debt trend

post https://api.intelig.ai/api/v1/intelig/code/repositories/branch-trend

Auth: Authorization: ApiKey <key> (an API key sent as Bearer is rejected) or Authorization: Bearer <jwt> for a dashboard session. operationId: getBranchTrend

Returns historical stale branch counts over time for the Hygiene tab line chart. Tracks branch debt accumulation and cleanup trends. Filterable by repository IDs in the request body.

Example request

curl -X POST "https://api.intelig.ai/api/v1/intelig/code/repositories/branch-trend" \
  -H "Authorization: ApiKey $INTELIG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "2024-01-01",
    "to": "2024-01-31",
    "repositoryIds": [
      10,
      11
    ]
  }'

Request body

application/json

FieldTypeRequiredDescription
from string yes Start date in YYYY-MM-DD format Example: 2024-01-01
to string yes End date in YYYY-MM-DD format Example: 2024-01-31
repositoryIds integer[] no Optional list of repository IDs to filter by; if empty, returns all repos Example: [10,11]

Response 200

application/json · ApiResponseBranchTrendDto

FieldTypeDescription
success boolean
message string
data BranchTrendDto Branch debt trend over time for hygiene tab line chart visualization

Status codes

  • 200 — Branch debt trend data returned
  • 400 — Invalid request body
  • 401 — Authentication required
  • 403 — Insufficient permissions for Code Intelligence pillar
  • 429 — —

Every response is wrapped in { success, message, data }. A 4xx means the request is wrong — do not retry it unchanged. A 429 carries Retry-After in seconds.