Endpoint
GET /api/v1/analytics/insights
Returns comprehensive analytics insights including merge time metrics, per-author statistics, AI verdict breakdown, confidence distribution, issue categories, and per-repository breakdown.
Authentication
Requires a valid JWT token in cookies (obtained via GitHub OAuth).
Query Parameters
Number of days to analyze (7-90)
Response
Pull request merge time statistics Median time from PR creation to merge
90th percentile merge time
Number of merged PRs analyzed
Per-author statistics sorted by PR count Total issues identified in reviews
Average AI review confidence (1-5)
AI review verdict distribution Number of PRs requesting changes
Number of PRs needing discussion
AI confidence score distribution (1=low, 5=high)
Per-repository metrics sorted by PR count Repository full name (owner/repo)
PR size distribution (lines changed)
Example Request
curl "https://your-backend.railway.app/api/v1/analytics/insights?days=30" \
-H "Cookie: access_token=your_jwt_token"
Example Response
{
"period" : {
"start" : "2026-02-08T00:00:00Z" ,
"end" : "2026-03-10T00:00:00Z" ,
"days" : 30
},
"merge_metrics" : {
"median_hours" : 4.2 ,
"p90_hours" : 24.5 ,
"count" : 45
},
"authors" : [
{
"author" : "alice" ,
"prs" : 12 ,
"merged" : 10 ,
"issues_flagged" : 8 ,
"avg_confidence" : 4.2
}
],
"verdicts" : {
"APPROVE" : 30 ,
"REQUEST_CHANGES" : 12 ,
"NEEDS_DISCUSSION" : 3
},
"confidence_dist" : {
"1" : 0 ,
"2" : 2 ,
"3" : 8 ,
"4" : 20 ,
"5" : 15
},
"issue_categories" : {
"critical" : 5 ,
"moderate" : 18 ,
"minor" : 32
},
"repos" : [
{
"repo" : "myorg/backend" ,
"prs" : 28 ,
"merged" : 24 ,
"issues_flagged" : 35
}
],
"pr_size" : {
"median" : 145 ,
"p90" : 580
}
}
Use Cases
Team Performance : Track merge times and author productivity
Quality Metrics : Monitor AI review verdicts and issue severity
Process Optimization : Identify bottlenecks in PR review process
Repository Health : Compare activity and quality across repositories
Summary Analytics High-level metrics overview
Contributors Detailed contributor profiles from AI memory