Browse the docs

POST /states/{name}/force

Forces a State on or off until it next changes, or for some minutes; clears the override with null.

Details #

The body is {"on": true}, {"on": false} or {"on": null}, and optionally "minutes": 30. Without minutes the override lasts until the State's own conditions next change its answer. null clears it.

curl -s -X POST -H "Authorization: Bearer $TOKEN" -d '{"on": true, "minutes": 60}' \
  "http://127.0.0.1:48080/states/Deep%20work/force"

Returns the State as GET /states lists it. A name that matches no State answers 404.

Parameters #

curl --unix-socket "$SWITCHBOARD_HOME/engine.sock" -X POST http://localhost/states/{name}/force

Force a State on or off until it next changes, or for some minutes. The Unix socket needs no token; loopback 127.0.0.1:48080 needs Authorization: Bearer <api-token>.

See also #