API Reference
Power Control
Control system power state remotely.
The power endpoints allow you to remotely control your computer's power state, including shutdown, restart, sleep, and hibernate.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /api/pw/shutdown | Initiates a system shutdown. |
POST | /api/pw/restart | Initiates a system restart. |
POST | /api/pw/sleep | Puts the system into sleep mode. |
POST | /api/pw/hibernate | Puts the system into hibernation. |
Response Timing
Power commands return a success response before the system action is triggered. This ensures the remote client receives confirmation before the connection is lost.
Example Requests
Shutdown
curl -X POST http://192.168.1.100:9990/api/pw/shutdownRestart
curl -X POST http://192.168.1.100:9990/api/pw/restartSleep
curl -X POST http://192.168.1.100:9990/api/pw/sleepHibernate
curl -X POST http://192.168.1.100:9990/api/pw/hibernateResponse
All power endpoints return the same success response:
{
"status": "ok",
"message": "Command initiated"
}Configuration
Power commands can be enabled or disabled in your config.yaml:
features:
...
enable_sleep: true # Enable sleep/hibernate commands
enable_restart: true # Enable restart commands
enable_shutdown: true # Enable shutdown commands
enable_hibernate: true # Enable hibernate commandsSecurity
These endpoints perform system-level actions. Ensure your Cntrl server is only accessible on your trusted local network.