Platform Analytics
Platform owner endpoints for accessing metrics and usage statistics.
Endpoints
| Method | Path | Description |
|---|---|---|
GET |
/api/platform/analytics/overview |
Platform overview |
GET |
/api/platform/analytics/organization-status |
Org status breakdown |
GET |
/api/platform/analytics/growth-trends |
Growth over time |
GET |
/api/platform/analytics/login-activity |
Login trends |
GET |
/api/platform/analytics/top-organizations |
Most active orgs |
GET |
/api/platform/analytics/recent-organizations |
Recently created |
GET /api/platform/analytics/overview
Get high-level platform metrics.
Response (200 OK)
{
"total_organizations": 142,
"total_users": 15420,
"total_services": 387,
"active_sessions_24h": 2845,
"logins_24h": 1523,
"new_users_7d": 234,
"new_orgs_7d": 12
}
GET /api/platform/analytics/organization-status
Get organization count by status.
Response (200 OK)
{
"pending": 8,
"active": 125,
"suspended": 4,
"rejected": 5
}
GET /api/platform/analytics/growth-trends
Get growth metrics over time.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
period |
string |
30d |
7d, 30d, 90d, 1y |
granularity |
string |
day |
day, week, month |
Response (200 OK)
{
"period": "30d",
"data": [
{"date": "2025-01-01", "users": 150, "organizations": 3, "logins": 520},
{"date": "2025-01-02", "users": 145, "organizations": 2, "logins": 498}
]
}
GET /api/platform/analytics/login-activity
Get login activity trends.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
period |
string |
7d |
Time period |
provider |
string |
- | Filter by auth provider |
Response (200 OK)
{
"total_logins": 4523,
"by_provider": {
"github": 2100,
"google": 1800,
"microsoft": 423,
"password": 200
},
"by_hour": [
{"hour": 0, "count": 45},
{"hour": 1, "count": 32}
]
}
GET /api/platform/analytics/top-organizations
Get most active organizations.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit |
integer |
10 | Number of results |
metric |
string |
logins |
logins, users, services |
Response (200 OK)
{
"organizations": [
{
"id": "org-uuid",
"slug": "acme-corp",
"name": "Acme Corporation",
"logins_7d": 523,
"users": 150,
"services": 5
}
]
}
GET /api/platform/analytics/recent-organizations
Get recently created organizations.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit |
integer |
10 | Number of results |
Response (200 OK)
{
"organizations": [
{
"id": "org-uuid",
"slug": "new-startup",
"name": "New Startup Inc",
"status": "pending",
"created_at": "2025-01-15T10:30:00Z",
"owner_email": "founder@startup.com"
}
]
}