API Reference / Code - Repositories
Get branch intelligence
post
https://api.intelig.ai/api/v1/intelig/code/repositories/branches
Auth: Authorization: ApiKey <key> (an API key sent as
Bearer is rejected) or Authorization: Bearer <jwt>
for a dashboard session. operationId: getBranchIntelligence
Returns comprehensive branch intelligence data for the Branch Intelligence table. Supports filtering, sorting, and pagination. Calculates branch status: ACTIVE (<7d), INACTIVE (7-30d), STALE (30d+), MERGED. Includes commit counts and authors.
Example request
curl -X POST "https://api.intelig.ai/api/v1/intelig/code/repositories/branches" \
-H "Authorization: ApiKey $INTELIG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "2024-01-01",
"to": "2024-01-31",
"repositoryIds": [
10,
11
],
"statuses": [
"ACTIVE",
"STALE"
]
}' Request body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
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 Example: [10,11] |
statuses | string[] | no | Optional list of branch statuses to filter by Example: ["ACTIVE","STALE"] |
search | string | no | Optional search term for branch name Example: feature/ |
sortBy | string | no | Sort field (defaults to last_commit_date) Example: last_commit_date |
sortOrder | string | no | Sort order: asc or desc (defaults to desc) Example: desc |
page | integer (int32) | no | Page number, 0-indexed (defaults to 0) Example: 0 |
size | integer (int32) | no | Page size (defaults to 20) Example: 20 |
Response 200
application/json · ApiResponseBranchIntelligenceDto
| Field | Type | Description |
|---|---|---|
success | boolean | — |
message | string | — |
data | BranchIntelligenceDto | Paginated branch intelligence data with summary statistics |
Status codes
200— Paginated branch intelligence data returned400— Invalid request body, filter, or sort parameters401— Authentication required403— Insufficient permissions for Code Intelligence pillar429— —
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.