API Reference
The Clawner dashboard exposes a REST API and WebSocket endpoint for managing hosts.
Authentication
Login
POST /api/login
Content-Type: application/json
{
"password": "your-password"
}Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Using the Token
Include the token in the Authorization header:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-dashboard.com:9000/hostsEndpoints
Health Check
GET /healthNo authentication required.
{
"status": "ok",
"hosts": 5,
"connectedHosts": 3
}List Hosts
GET /hostsReturns all registered hosts.
[
{
"id": "host-abc123",
"name": "Production Server",
"hostname": "prod-01",
"ipAddress": "192.168.1.100",
"openclawVersion": "2026.3.2",
"openclawInstalled": true,
"status": "connected",
"lastSeen": "2026-03-10T00:30:00Z"
}
]Get Host Details
GET /hosts/:idGet Host Metrics
GET /hosts/:id/metrics?hours=24Returns time-series metrics for the specified host.
[
{
"timestamp": 1710028200000,
"cpu_load": 0.5,
"memory_used": 4294967296,
"memory_total": 8589934592,
"load_1m": 0.5,
"load_5m": 0.4,
"load_15m": 0.3
}
]Send Command
POST /hosts/:id/command
Content-Type: application/json
{
"type": "gateway_status"
}Available Commands
| Command | Description | Payload |
|---|---|---|
get_status | Full host status | — |
version | OpenClaw version | — |
health | Gateway health | — |
gateway_status | Detailed gateway status | — |
start_gateway | Start gateway | { background: true } |
stop_gateway | Stop gateway | — |
restart_gateway | Restart gateway | — |
list_agents | List agents | — |
add_agent | Create agent | { name, model, ... } |
delete_agent | Remove agent | { id } |
get_config | Read config | — |
logs | Get logs | { lines: 100 } |
doctor | Health checks | — |
update_openclaw | Update OpenClaw | — |
Generate Invite Code
POST /inviteReturns a new invite code for connecting hosts.
{
"code": "ABC123XY",
"expiresAt": "2026-03-11T00:30:00Z"
}WebSocket
Dashboard Connection
Connect to receive real-time updates:
const ws = new WebSocket('wss://your-dashboard.com/ws?dashboard=true');
ws.onmessage = (event) => {
const { event: eventType, data } = JSON.parse(event.data);
switch (eventType) {
case 'host_connected':
console.log('Host connected:', data);
break;
case 'host_disconnected':
console.log('Host disconnected:', data);
break;
case 'host_updated':
console.log('Host updated:', data);
break;
}
};Events
| Event | Description |
|---|---|
welcome | Connection established |
host_connected | New host joined |
host_disconnected | Host went offline |
host_updated | Host metrics updated |