Skip to content

Admin Dashboard API

The Admin API provides comprehensive system management and monitoring capabilities.

Endpoints

System Overview

GET /api/v1/admin/overview

Response:

{
  "success": true,
  "system": {
    "status": "healthy",
    "uptime_hours": 72.5,
    "cpu_usage_percent": 23.4,
    "memory_usage_percent": 67.8,
    "active_connections": 147,
    "requests_per_minute": 89.3
  },
  "users": {
    "total_users": 1247,
    "active_users_today": 89,
    "subscription_tiers": {
      "free": 892,
      "professional": 298,
      "enterprise": 57
    }
  },
  "orchestrators": {
    "total_orchestrators": 28,
    "total_runs_today": 423,
    "success_rate_percent": 98.7
  },
  "financial": {
    "total_costs_today": 245.67,
    "revenue_today": 2847.92,
    "profit_margin": 92.3
  }
}

User Management

GET /api/v1/admin/users

Query Parameters: - page - Page number (default: 1) - limit - Items per page (default: 50) - search - Search term

Response:

{
  "success": true,
  "users": [
    {
      "id": "user_123",
      "email": "user@example.com",
      "subscription_tier": "professional",
      "created_at": "2025-08-01T10:00:00Z",
      "last_active": "2025-08-12T13:30:00Z",
      "total_usage": {
        "orchestrator_runs": 45,
        "team_deployments": 12,
        "api_calls": 1250
      }
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 1247,
    "total_pages": 25
  }
}

System Logs

GET /api/v1/admin/logs

Query Parameters: - level - Log level (all, info, warning, error, debug) - limit - Number of logs (default: 100) - component - Filter by component

Response:

{
  "success": true,
  "logs": [
    {
      "timestamp": "2025-08-12T14:00:00Z",
      "level": "INFO",
      "component": "api",
      "message": "User login successful",
      "metadata": {
        "user_id": "user_123",
        "ip_address": "192.168.1.100"
      }
    }
  ],
  "available_levels": ["INFO", "WARNING", "ERROR", "DEBUG"],
  "available_components": ["api", "orchestrator", "websocket", "auth"]
}

System Configuration

GET /api/v1/admin/config

Response:

{
  "success": true,
  "configuration": {
    "server": {
      "host": "0.0.0.0",
      "port": 47187,
      "max_connections": 1000
    },
    "features": {
      "websocket_enabled": true,
      "chat_enabled": true,
      "payment_processing": true
    },
    "limits": {
      "max_orchestrator_runs_per_hour": 100,
      "max_api_calls_per_minute": 1000
    }
  },
  "editable_sections": ["server", "features", "limits"]
}

Update Configuration

PUT /api/v1/admin/config

Request Body:

{
  "server": {
    "max_connections": 1500
  },
  "limits": {
    "max_api_calls_per_minute": 1200
  }
}

Create System Alert

POST /api/v1/admin/alerts

Request Body:

{
  "type": "warning",
  "message": "High memory usage detected",
  "category": "performance"
}

Analytics Dashboard

GET /api/v1/admin/analytics

Query Parameters: - timeframe - day, week, month, year - metric_type - all, usage, financial, performance

Response:

{
  "success": true,
  "timeframe": "week",
  "time_series": [
    {
      "timestamp": "2025-08-11T00:00:00Z",
      "orchestrator_runs": 45,
      "team_deployments": 12,
      "api_calls": 1250,
      "revenue": 289.50
    }
  ],
  "summary": {
    "total_orchestrator_runs": 315,
    "total_revenue": 2026.50,
    "avg_active_users": 89.3
  }
}

Alert Types

  • info - Informational messages
  • warning - Warning conditions
  • critical - Critical system alerts
  • success - Success notifications

Permission Levels

  • super_admin - Full system access
  • system_admin - System management
  • user_admin - User management only
  • analytics_viewer - Read-only analytics

Generated on 2025-08-12 14:48:04