Skip to Content
HomeLink Hub
Admin

Get dashboard statistics

GET
/api/v1/admin/dashboard/stats

Access: Bearer token required. Roles: ADMIN.

Platform-wide counters for the admin dashboard, computed live on each call. totalUsers counts every user document; newUsersThisMonth counts sign-ups since the first of the current month (UTC). totalProperties excludes soft-deleted properties; activeListings is properties with status listed; pendingVerification is status pending_verification; duplicateFlagsOpen is duplicate flags still open. Money figures come from escrow transactions with status completed only: totalRevenue is the sum of their platformFee, transactionVolume the sum of their amount, completedDeals their count. escrowsInFlight counts escrows that are pending or funded. userGrowth always has 12 entries (JAN to DEC) for the current UTC year; usersByRole always has all six roles.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Access token returned by sign-in. Send it as Authorization: Bearer <token>.

Response Body

Counters (userGrowth trimmed to one of its 12 months)

application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X GET 'http://localhost:4000/api/v1/admin/dashboard/stats'
Example Response
{  "status": 200,  "success": true,  "message": "Dashboard stats fetched successfully",  "data": {    "totalUsers": 1284,    "newUsersThisMonth": 97,    "totalProperties": 412,    "activeListings": 288,    "pendingVerification": 41,    "duplicateFlagsOpen": 3,    "totalRevenue": 6450000,    "transactionVolume": 645000000,    "completedDeals": 152,    "escrowsInFlight": 17,    "userGrowth": [      {        "month": "JAN",        "users": 84      }    ],    "usersByRole": {      "TENANT": 941,      "LANDLORD": 112,      "AGENT": 187,      "LAWYER": 31,      "DEVELOPER": 9,      "ADMIN": 4    }  }}