Browse the docs

POST /vars/{name}

Sets a shared variable, or removes it with null.

Details #

The body is {"value": ...}: any JSON value. Leave value out or send null to remove the variable. A name without shared. gets the prefix.

curl -s -X POST -H "Authorization: Bearer $TOKEN" -d '{"value": "deep work"}' http://127.0.0.1:48080/vars/mode

Returns {"name", "value"} as it is now stored.

Parameters #

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

Set a shared variable, or remove it with null. The Unix socket needs no token; loopback 127.0.0.1:48080 needs Authorization: Bearer <api-token>.

See also #