Authentication
Authenticate user and retrieve JWT token.
Request:
{
"username": "admin",
"password": "Admin@123"
}
Response Example:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 3600
}
cURL:
curl -X POST 'https://localhost:443/api/auth/login' \\
-H 'Content-Type: application/json' \\
-d '{"username":"admin","password":"Admin@123"}'
Get details of the currently authenticated user.
Response Example:
{
"id": "a1b2c3d4",
"username": "admin",
"email": "admin@example.com",
"roles": ["Admin"]
}
cURL:
curl -X GET 'https://localhost:443/api/auth/current-user' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
Terminal
Execute a terminal command on the server.
Request:
{
"command": "echo Hello World",
"terminalType": "Bash"
}
Response Example:
{
"output": "Hello World",
"exitCode": 0
}
cURL:
curl -X POST 'https://localhost:443/api/terminal/execute' \\
-H 'Authorization: Bearer <JWT_TOKEN>' \\
-H 'Content-Type: application/json' \\
-d '{"command":"echo Hello World","terminalType":"Bash"}'
Retrieve a list of supported terminal types.
Response Example:
{
"supportedTypes": ["Bash", "PowerShell", "Cmd"]
}
cURL:
curl -X GET 'https://localhost:443/api/terminal/supportedtypes' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
System
Retrieve an overview of system metrics (CPU, memory, disk, etc.).
Response Example:
{
"cpuUsage": 45.7,
"memoryUsage": 60.3,
"diskUsage": 75.0,
"networkUsage": 12.5
}
cURL:
curl -X GET 'https://localhost:443/api/system/overview' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
Retrieve detailed CPU information.
Response Example:
{
"model": "Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz",
"cores": 6,
"usage": 45.7
}
cURL:
curl -X GET 'https://localhost:443/api/system/cpu' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
Retrieve detailed GPU information.
Response Example:
{
"model": "NVIDIA GeForce RTX 2060",
"memoryUsage": 35.2,
"temperature": 65.0
}
cURL:
curl -X GET 'https://localhost:443/api/system/gpu' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
Retrieve detailed memory (RAM) information.
Response Example:
{
"totalMemory": 16384,
"usedMemory": 9876,
"freeMemory": 6508
}
cURL:
curl -X GET 'https://localhost:443/api/system/memory' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
Retrieve detailed network information.
Response Example:
{
"interfaces": [
{
"name": "eth0",
"sentBytes": 123456,
"receivedBytes": 654321
}
]
}
cURL:
curl -X GET 'https://localhost:443/api/system/network' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
Retrieve detailed storage (disk) information.
Response Example:
{
"disks": [
{
"name": "sda1",
"totalSpace": 500000,
"usedSpace": 250000,
"freeSpace": 250000
}
]
}
cURL:
curl -X GET 'https://localhost:443/api/system/storage' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
Processes
Retrieve a list of running processes.
Query Parameters:
showAll=false&searchTerm=chrome&sortColumn=Cpu&ascending=false
Response Example:
[
{
"pid": 1234,
"name": "chrome",
"cpuUsage": 25.3,
"memoryUsage": 1024
}
]
cURL:
curl -X GET "https://localhost:443/api/processes?showAll=false&searchTerm=chrome&sortColumn=Cpu&ascending=false" \\
-H "Authorization: Bearer <JWT_TOKEN>"
Terminate a running process by its name or PID.
Request:
{
"processName": "chrome"
}
Response Example:
"Process terminated successfully."
cURL:
curl -X POST 'https://localhost:443/api/processes/kill' \\
-H 'Authorization: Bearer <JWT_TOKEN>' \\
-H 'Content-Type: application/json' \\
-d '{"processName":"chrome"}'
Role Management
Retrieve all users with their assigned roles.
Response Example:
{
"users": [
{
"id": "a1b2c3d4",
"userName": "admin@example.com",
"email": "admin@example.com",
"emailConfirmed": true,
"phoneNumber": null,
"twoFactorEnabled": false
}
],
"roles": [
{
"id": "role-123",
"name": "Admin"
}
],
"userRoles": {
"a1b2c3d4": "Admin"
}
}
cURL:
curl -X GET 'https://localhost:443/api/rolemanagement/users' \\
-H 'Authorization: Bearer <JWT_TOKEN>'
Create a new user with a specified role.
Request:
{
"email": "user@example.com",
"password": "Password123!",
"confirmPassword": "Password123!",
"role": "Admin"
}
Success Response:
"User created and role assigned successfully."
cURL:
curl -X POST 'https://localhost:443/api/rolemanagement/create-user' \\
-H 'Authorization: Bearer <JWT_TOKEN>' \\
-H 'Content-Type: application/json' \\
-d '{"email":"user@example.com","password":"Password123!","confirmPassword":"Password123!","role":"Admin"}'
Assign or update a user's role.
Request:
{
"userId": "a1b2c3d4",
"roleId": "role-123"
}
Success Response:
"Role assigned successfully."
cURL:
curl -X POST 'https://localhost:443/api/rolemanagement/assign-role' \\
-H 'Authorization: Bearer <JWT_TOKEN>' \\
-H 'Content-Type: application/json' \\
-d '{"userId":"a1b2c3d4","roleId":"role-123"}'
Permanently delete a user.
Request:
{
"userId": "a1b2c3d4"
}
Success Response:
"User deleted successfully."
cURL:
curl -X POST 'https://localhost:443/api/rolemanagement/delete-user' \\
-H 'Authorization: Bearer <JWT_TOKEN>' \\
-H 'Content-Type: application/json' \\
-d '{"userId":"a1b2c3d4"}'
Reset a user's password (admin override).
Request:
{
"userId": "a1b2c3d4",
"newPassword": "NewSecurePassword123!"
}
Success Response:
"Password reset successfully."
cURL:
curl -X POST 'https://localhost:443/api/rolemanagement/reset-password' \\
-H 'Authorization: Bearer <JWT_TOKEN>' \\
-H 'Content-Type: application/json' \\
-d '{"userId":"a1b2c3d4","newPassword":"NewSecurePassword123!"}'
File Explorer
List directory contents with metadata.
Query Parameters:
path=/valid/directory/path
Response Example:
[
{
"Name": "document.txt",
"Path": "/path/to/document.txt",
"IsDirectory": false,
"Size": 1024,
"LastModified": "2023-08-15T14:30:00"
},
{
"Name": "Subfolder",
"Path": "/path/to/Subfolder",
"IsDirectory": true,
"Size": 0,
"LastModified": "2023-08-10T09:15:00"
}
]
cURL:
curl -X GET "https://localhost:443/api/FileExplorer/list?path=/directory/path" \\
-H "Authorization: Bearer <JWT_TOKEN>"
Download a specific file.
Query Parameters:
path=/valid/file/path.txt
cURL:
curl -X GET "https://localhost:443/api/FileExplorer/files?path=/path/to/file.txt" \\
-H "Authorization: Bearer <JWT_TOKEN>" --output downloaded_file.txt
Permanently delete a file.
Query Parameters:
path=/valid/file/path.txt
cURL:
curl -X DELETE "https://localhost:443/api/FileExplorer/files?path=/path/to/file.txt" \\
-H "Authorization: Bearer <JWT_TOKEN>"
Recursively delete a directory.
Query Parameters:
path=/valid/directory/path
cURL:
curl -X DELETE "https://localhost:443/api/FileExplorer/directories?path=/path/to/directory" \\
-H "Authorization: Bearer <JWT_TOKEN>"
Create a new directory.
Query Parameters:
path=/parent/directory/path&name=new_directory_name
cURL:
curl -X POST "https://localhost:443/api/FileExplorer/directories?path=/parent/path&name=new_folder" \\
-H "Authorization: Bearer <JWT_TOKEN>"