API Documentation

Authentication

POST /api/admin/login

Authenticate admin access.

{ "key": "your_admin_key" }
Response
{ "success": true }

User Management

GET /api/admin/users

Get all registered users.

Response
{ "success": true, "users": [ { "id": 1, "username": "user1", "hwid": "hwid_string", "blacklisted": false } ] }
GET /api/admin/active-users

Get all currently active users.

Response
{ "success": true, "activeUsers": [ { "hwid": "hwid_string", "username": "user1", "connectedAt": "timestamp", "lastHeartbeat": "timestamp" } ] }
POST /api/admin/ban/:userId

Ban a specific user.

Response
{ "success": true }
POST /api/admin/unban/:userId

Unban a specific user.

Response
{ "success": true }
POST /api/admin/reset-hwid/:userId

Reset HWID for a specific user.

Response
{ "success": true, "message": "HWID reset successful" }
GET /api/admin/user/:userId/rank

Get the current rank of a specific user.

Response
{ "success": true, "rank": "string" }
POST /api/admin/user/:userId/rank

Update the rank of a specific user.

{ "rank": "string" }
Response
{ "success": true, "message": "User rank updated successfully" }

Token Management

GET /api/admin/tokens

Get all authentication tokens.

Response
{ "success": true, "tokens": [ { "token": "token_string", "used": false, "created_at": "timestamp" } ] }
POST /api/admin/generate-token

Generate a new authentication token.

Response
{ "success": true, "token": "generated_token_string" }

Client Control

POST /api/admin/send-message

Send a message to a specific client.

{ "hwid": "client_hwid", "message": "Your message" }
Response
{ "success": true }
POST /api/admin/close-app

Force close the application for a specific client.

{ "hwid": "client_hwid" }
Response
{ "success": true }
POST /api/admin/shutdown-pc

Shutdown the PC for a specific client.

{ "hwid": "client_hwid" }
Response
{ "success": true }

Version Control

GET /api/admin/version

Get current application version.

Response
{ "success": true, "version": "1.0.0" }
POST /api/admin/update-version

Update application version.

{ "version": "new_version_string" }
Response
{ "success": true, "version": "new_version_string" }

User Statistics

GET /api/admin/user-stats/:userId

Get execution statistics for a specific user.

Response
{ "success": true, "stats": { "totalExecutions": 150, "avgExecutionTime": "2.3s", "peakMemoryUsage": "256MB", "peakCPUUsage": "45%", "executionHistory": [ { "timestamp": "2024-03-14T12:00:00Z", "executionTime": "2.1s", "memoryUsage": "234MB", "cpuUsage": "35%" } ] } }
GET /api/admin/execution-analytics

Get execution analytics for all users or a specific user.

{ "userId": "optional_user_id", "timeRange": "24h" // Options: 24h, 7d, 30d, all }
Response
{ "success": true, "analytics": { "executionTimeData": [ { "timestamp": "2024-03-14T12:00:00Z", "value": 2.1 } ], "memoryUsageData": [ { "timestamp": "2024-03-14T12:00:00Z", "value": 234 } ], "cpuUsageData": [ { "timestamp": "2024-03-14T12:00:00Z", "value": 35 } ] } }
GET /api/admin/performance-metrics

Get overall performance metrics across all users.

Response
{ "success": true, "metrics": { "totalExecutions": 1500, "avgExecutionTime": "2.5s", "avgMemoryUsage": "245MB", "avgCPUUsage": "40%", "peakConcurrentUsers": 25, "dailyActiveUsers": 50 } }

Database Management

GET /api/admin/table/:tableName

Get data from a specific database table (users or tokens).

Response
{ "success": true, "rows": [/* table data */] }
POST /api/admin/table/:tableName/update

Update data in a specific database table.

{ "original": [/* original data */], "updated": [/* updated data */] }
Response
{ "success": true }