GET /admin/stats

Get system-wide statistics for admin dashboard including API keys, devices, and webhook counts

Responses

  • 200 application/json

    Statistics retrieved successfully

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • total_api_keys integer
      • active_api_keys integer
      • total_devices integer
      • connected_devices integer
      • disconnected_devices integer
      • pending_devices integer
      • logged_out_devices integer
      • total_webhooks integer
      • active_webhooks integer
  • 401 application/json

    Unauthorized - Invalid admin secret

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
GET /admin/stats
curl \
 --request GET 'http://localhost:7001/admin/stats' \
 --header "X-Admin-Secret: $API_KEY"
Response examples (200)
{
  "code": 200,
  "data": {
    "total_devices": 25,
    "total_api_keys": 5,
    "total_webhooks": 12,
    "active_api_keys": 4,
    "active_webhooks": 10,
    "pending_devices": 2,
    "connected_devices": 18,
    "logged_out_devices": 0,
    "disconnected_devices": 5
  },
  "status": true,
  "message": "Statistics retrieved successfully"
}
Response examples (200)
{
  "status": true,
  "code": 200,
  "message": "Statistics retrieved successfully",
  "data": {
    "total_api_keys": 5,
    "active_api_keys": 4,
    "total_devices": 25,
    "connected_devices": 18,
    "disconnected_devices": 5,
    "pending_devices": 2,
    "logged_out_devices": 0,
    "total_webhooks": 12,
    "active_webhooks": 10
  }
}
Response examples (401)
{
  "code": 401,
  "error": "Invalid or missing admin secret",
  "status": false,
  "message": "Unauthorized"
}
Response examples (401)
{
  "status": false,
  "code": 401,
  "message": "Unauthorized",
  "error": "Invalid or missing authentication"
}
Response examples (500)
{
  "code": 500,
  "error": "Failed to retrieve statistics",
  "status": false,
  "message": "Internal server error"
}
Response examples (500)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}