Set the power budget
POST
/api/v1/budget
const url = 'http://pwrman.local/api/v1/budget';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"watts":240}'};
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/budget \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "watts": 240 }'The total power the ports may promise their devices. Saved, and
applied at once. The same value is budget_w in the settings.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
watts
required
integer
Example
{ "watts": 240}Responses
Section titled “Responses”Done.
Media typeapplication/json
object
ok
required
boolean
Example
{ "ok": true}The value is outside 15–600 W.
Media typeapplication/json
object
error
required
Why the request was refused, in words.
string
Example
{ "error": "watts out of range"}The token is missing or wrong, or no token is set yet.
Media typeapplication/json
object
error
required
Why the request was refused, in words.
string
Examples
{ "error": "bearer token required"}{ "error": "no API token set yet: finish first-time setup first"}The controller is busy with another request. Try again.
Media typeapplication/json
object
error
required
Why the request was refused, in words.
string
Example
{ "error": "busy, retry"}USB Type-C® and USB-C® are registered trademarks of USB Implementers Forum.