API Reference / Code - Repositories

Get branches by state

post https://api.intelig.ai/api/v1/intelig/code/repositories/branches-by-state

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

Returns branches filtered by hygiene state for Hygiene tab drill-down sheets. Supports ALL, STALE, and ACTIVE state filters with optional repository filter. Includes branch name, last commit date, and author information.

Example request

curl -X POST "https://api.intelig.ai/api/v1/intelig/code/repositories/branches-by-state" \
  -H "Authorization: ApiKey $INTELIG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "2024-01-01",
    "to": "2024-01-31",
    "state": "STALE",
    "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
state string yes Branch hygiene state to filter by (ALL, STALE, or ACTIVE) One of: ALL, STALE, ACTIVE Example: STALE
repositoryIds integer[] no Optional list of repository IDs to filter by Example: [10,11]
limit integer (int32) no Maximum number of branches to return (defaults to 50) Example: 50

Response 200

application/json · ApiResponseBranchesByStateDto

FieldTypeDescription
success boolean
message string
data BranchesByStateDto Branches filtered by hygiene state for drill-down views

Status codes

  • 200 — Filtered branch list returned
  • 400 — Invalid request body or unsupported state filter
  • 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.