Get Dashboard Overview (v1)
Get platform dashboard statistics including workspace counts, subscription metrics, payment statistics, and attention orders.
Method & Path
GET /v1/admin/dashboard/overview
Description
Retrieves comprehensive platform-wide dashboard statistics including:
- Total number of workspaces (businesses)
- Active subscription count
- Monthly recurring revenue from subscriptions
- Monthly revenue (all payments this month)
- Payment statistics (today, this week, this month, total)
- Expense statistics (today, this week, this month, total)
- Revenue breakdown by payment type for the current month
- Orders that require attention
All metrics are calculated in real-time from the database.
Authentication
Required: Admin authentication with dashboard.view permission.
Include the admin JWT token in the Authorization header:
Authorization: Bearer <admin_token>
Headers
Authorization: Bearer <admin_token>
Content-Type: application/json
Query Parameters
None.
Request Body
None.
Response 200 OK
{
"metrics": {
"totalBusinesses": 150,
"pendingApprovals": 0,
"activeSubscriptions": 142,
"monthlyRecurringRevenue": 8520.50,
"monthlyRevenue": 15200.75
},
"paymentStats": {
"today": {
"amount": 125.00,
"count": 3
},
"thisWeek": {
"amount": 890.00,
"count": 18
},
"thisMonth": {
"amount": 15200.75,
"count": 285
},
"total": {
"amount": 98750.25,
"count": 1523
}
},
"revenueByType": {
"ai-tools": 2450.00,
"sms": 890.50,
"storage": 120.25,
"subscription": 11740.00
},
"expenseStats": {
"today": {
"amount": 250.00,
"count": 2
},
"thisWeek": {
"amount": 1500.00,
"count": 8
},
"thisMonth": {
"amount": 8500.00,
"count": 35
},
"total": {
"amount": 75000.00,
"count": 320
}
},
"attentionOrders": [
{
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"status": "pending",
"total": 150.00,
"createdAt": "2024-01-15T10:00:00Z"
}
]
}
Response Fields
metrics
totalBusinesses(number): Total count of all workspaces in the systempendingApprovals(number): Currently always 0 (approval system not implemented)activeSubscriptions(number): Count of workspaces with active subscriptions (subscriptionEndDate is null or in the future)monthlyRecurringRevenue(number): Total revenue from subscription payments this month (USD)monthlyRevenue(number): Total revenue from all payment types this month (USD)
paymentStats
Payment statistics with amount and count for different time periods:
today: Payments from the start of todaythisWeek: Payments from the start of the current week (Sunday)thisMonth: Payments from the start of the current monthtotal: All-time payment statistics
Each period includes:
amount(number): Total payment amount in USDcount(number): Total number of payments
revenueByType
Revenue breakdown by payment type for the current month:
ai-tools(number): Total revenue from AI tools paymentssms(number): Total revenue from SMS paymentsstorage(number): Total revenue from storage paymentssubscription(number): Total revenue from subscription payments
All amounts are in USD.
expenseStats
Expense statistics with amount and count for different time periods:
today: Expenses from the start of todaythisWeek: Expenses from the start of the current week (Sunday)thisMonth: Expenses from the start of the current monthtotal: All-time expense statistics
Each period includes:
amount(number): Total expense amount in USDcount(number): Total number of expenses
All amounts are in USD.
attentionOrders
Array of storefront orders that require admin attention (status: pending, etc.)
Common Errors
- 401 Unauthorized: Missing or invalid admin authentication token
- 403 Forbidden: Insufficient permissions (missing
dashboard.viewpermission) - 500 Internal Server Error: Server error (may occur if fetching attention orders fails, but request still succeeds with empty array)
Notes
- All date-based calculations use UTC timezone
- Monthly recurring revenue only includes subscription-type payments from the current calendar month
- Monthly revenue includes all payment types (subscription, ai-tools, sms, storage) from the current calendar month
- Active subscriptions are determined by checking if
subscriptionEndDateis null or greater than the current date/time - Payment statistics include all payment types (subscription, ai-tools, sms, storage)
- Revenue by type only reflects payments from the current calendar month
- Expense statistics include all platform expenses across all categories