API Reference

Complete API endpoint documentation

Authentication Routes

Method Endpoint Description Auth Required
GET /login Display login form
POST /login Authenticate user
GET /logout Logout user
GET /register Registration form
POST /register Create new user
GET /verify-email?token= Verify email address
GET /forgot-password Password reset request form
POST /forgot-password Send reset email
GET /reset-password?token= Password reset form
POST /reset-password Update password

Dashboard Routes

Method Endpoint Description Auth Required
GET /dashboard Main dashboard view
POST /dashboard/tasks Fetch host tasks

Credit System Routes

Method Endpoint Description Auth Required
GET /credits View balance & transaction history
GET /credits/topup Top-up form
POST /credits/payment/create Create PayPal payment
GET /credits/payment/success Payment success callback
GET /credits/payment/cancel Payment cancelled callback

Admin - Hosts

Method Endpoint Description Admin Only
GET /admin/hosts List all hosts
GET /admin/hosts/create Create host form
POST /admin/hosts/store Save new host
GET /admin/hosts/edit?id=X Edit host form
POST /admin/hosts/update Update host
POST /admin/hosts/delete Delete host
POST /admin/hosts/sync Sync VMs from PVE host

Admin - Groups

Method Endpoint Description Admin Only
GET /admin/groups List all groups
GET /admin/groups/create Create group form
POST /admin/groups/store Save new group
GET /admin/groups/edit?id=X Edit group form
POST /admin/groups/update Update group
POST /admin/groups/delete Delete group

User - Groups

Method Endpoint Description Auth Required
POST /groups/purchase Purchase group with credits

VM Management

Method Endpoint Description Permission
GET /dashboard/vms List VMs vm.view
POST /dashboard/vms/action VM action (start/stop/restart) vm.start/stop/restart
GET /dashboard/vms/console Access VM console vm.console

Network Management

Method Endpoint Description Permission
GET /dashboard/network View network configuration network.view
POST /dashboard/network/create Create network network.manage
POST /dashboard/network/delete Delete network network.manage

Backup Management

Method Endpoint Description Permission
GET /dashboard/backups List backups backup.view
POST /dashboard/backups/create Create backup backup.create

Response Formats

Success Response
{
    "success": true,
    "message": "Operation completed successfully",
    "data": { ... }
}
Error Response
{
    "success": false,
    "error": "Error message",
    "code": 400
}

Webhooks

PayPal Webhook

POST /webhook/paypal

Receives PayPal webhook events for payment verification.

Features:
  • Signature verification (HMAC-SHA256)
  • Duplicate event prevention
  • Automatic credit addition on payment completion
  • Event logging for audit trail
Supported Events:
  • PAYMENT.SALE.COMPLETED - Payment successful
  • PAYMENT.SALE.DENIED - Payment denied
  • PAYMENT.SALE.REFUNDED - Payment refunded
Configuration:
PAYPAL_WEBHOOK_ID=your_webhook_id
PAYPAL_MODE=live  # or sandbox
Response:
{
    "status": "success"
}