API Reference / Code - Repositories

Get freshness distribution

post https://api.intelig.ai/api/v1/intelig/code/repositories/freshness

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

Returns repository freshness distribution for the Health tab bar chart. Buckets repositories by days since last commit: <7d (active), 7-30d (aging), 30-90d (stale), 90d+ (abandoned). Filterable by repository IDs in the request body.

Example request

curl -X POST "https://api.intelig.ai/api/v1/intelig/code/repositories/freshness" \
  -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 · ApiResponseFreshnessDistributionDto

FieldTypeDescription
success boolean
message string
data FreshnessDistributionDto Repository freshness distribution bucketed by last activity age

Status codes

  • 200 — Freshness distribution buckets 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.