API Reference

LiteSoup exposes agent endpoints on managed servers and a dashboard REST API.

Dashboard API

The dashboard exposes a REST API at /api/*. All endpoints require authentication via JWT cookie (obtained by logging in through the web UI).

Authentication

Login via POST /api/auth/login with { "email": "...", "password": "..." }. A JWT cookie is set automatically. All subsequent API calls include this cookie.

Endpoints

Method Path Description
GET/api/serversList all servers
POST/api/serversConnect a server
PATCH/api/servers/:idUpdate server name/hostname/tags
GET/api/servers/:id/sitesList sites on a server
POST/api/servers/:id/sitesCreate a new site
GET/api/servers/:id/sites/:siteIdGet site detail
POST/api/servers/:id/syncTrigger server sync
POST/api/servers/:id/wp-scanRun WordPress scan
POST/api/servers/:id/pool-applyApply pool tier config
GET/api/activityList activity log
GET/api/settingsGet all settings
PUT/api/settings/:keyUpdate a setting
GET/api/pool-tiersList pool tiers
PUT/api/pool-tiers/:idUpdate a pool tier

Agent Endpoints

Each server runs an agent that exposes HTTP endpoints on localhost (port 7777). The dashboard communicates with these endpoints to execute commands and collect metrics.

Method Path Description
GET/healthAgent liveness check
GET/metricsCPU, RAM, disk metrics
GET/servicesSystemd service statuses
GET/sitesDiscovered sites list
POST/execExecute a CLI command (SSE stream)
POST/sites/wp-scanWordPress deep scan (SSE stream)
POST/sites/db-passwordRead DB password from wp-config.php

The /exec endpoint accepts { "command": "site.create", "params": { ... } } and returns an SSE stream. Supported commands include site.create, site.delete, site.set-php, site.set-tier, site.set-tls, db.password, and pool.apply.

Agent Registration

Servers can register with the dashboard automatically via a one-time token. Navigate to Servers > Connect server to generate a registration token. The server runs the agent which connects back to the dashboard.

Related