Change settings
const url = 'http://pwrman.local/api/v1/settings';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"port_priorities":[1,2,0,3,4,5]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://pwrman.local/api/v1/settings \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "port_priorities": [ 1, 2, 0, 3, 4, 5 ] }'Send any subset of the keys. Keys left out keep their value, and unknown keys are ignored. The whole body is checked before anything changes, so one bad value changes nothing.
The device name, Wi-Fi, MQTT broker and addressing apply after
POST /api/v1/reboot; the reply’s reboot_required says when one is
needed. Everything else applies at once.
Posting an export back restores it. During first-time setup the body
must be sent as application/json and must set token.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Device name, used for <name>.local and the MQTT topics.
MQTT broker; empty turns MQTT off.
Connect to the broker over TLS.
With mqtt_tls, check the broker’s certificate.
The broker’s CA certificate as PEM, up to 2048 bytes as DER; empty for none. Without one a verified link trusts the Let’s Encrypt roots.
A contract event for every voltage step a PPS or SPR AVS sink takes. Off, the event comes only when the sink switches to that range or away from it.
Static address, as a dotted quad or empty.
DNS server; empty uses the one DHCP names (the gateway with static addressing).
Time server; empty uses the one DHCP names, or time.cloudflare.com.
Extra host names the web server answers to, separated by spaces. Commas are also accepted when writing.
Syslog server; empty sends no syslog.
Update source, as http://host[:port][/path] without a trailing slash; empty never checks.
New releases install by themselves.
Also require the API token to read status, the fault log, the certificate details and Prometheus metrics.
The power budget, in watts.
Automatic mode turns the fan on at this total power, in watts.
Automatic mode turns the fan off at this total power, in watts. Must be below fan_on_w.
Automatic mode also runs the fan while any contract is above this current, in mA; 0 turns this off.
A device drawing less than this, in mW, for charged_min minutes counts as charged; 0 turns this off.
The light sweep at power-up.
Brightness during the night window and when idle.
Night window as HH:MM-HH:MM local time; empty for none.
Dim after this many minutes without a port event; 0 never.
Local time minus UTC, in minutes.
Set each blade, once, to start through its bootloader, so the controller can update it.
A switched-off blade the controller has not addressed for this many seconds restarts into its bootloader; 0 never.
Port names; empty for the default name.
Power limit per port, in watts.
The highest voltage each port offers.
Priority per port; 0 is the most important.
Each port’s state at power-up.
1 switches the port off once its device is charged.
Switch the port off this many minutes after a device connects; 0 never.
The API token; printable ASCII without spaces.
Turn HTTPS on or off. Needs an installed certificate.
Examples
Make port 3 the most important
{ "port_priorities": [ 1, 2, 0, 3, 4, 5 ]}Name the first two ports
{ "port_names": [ "Laptop", "Phone" ]}Responses
Section titled “Responses”Saved.
object
A changed setting takes effect after POST /api/v1/reboot.
Example
{ "ok": true, "reboot_required": false}A value is out of range or malformed. Nothing was changed.
object
Why the request was refused, in words.
Examples
{ "error": "port_limits_w: 5-100 W each"}{ "error": "https: install a certificate first (POST /api/v1/tls)"}{ "error": "set an API token to finish setup"}The token is missing or wrong. On a controller with no token yet, the error says how to open first-time setup.
object
Why the request was refused, in words.
Examples
{ "error": "bearer token required"}{ "error": "no API token yet: Wi-Fi setup unlocks settings for an hour, or connect Ethernet"}A request let in by first-time setup was not sent as JSON.
object
Why the request was refused, in words.
Example
{ "error": "settings must be sent as application/json"}The settings could not be saved.
object
Why the request was refused, in words.
Example
{ "error": "flash save failed"}USB Type-C® and USB-C® are registered trademarks of USB Implementers Forum.