Your own effects
Make an effect
POST
/api/custom-effectsGuest area “effects”. Open unless a PIN lock is set and guests aren't allowed this area (
settings.guest.effects); then it needs an unlock token.Makes an effect from a pattern, an axis, what drives it and its colours. Answers it with its id (u-…). At most 100.
Request body application/json
namestringUp to 40 characters
patternstringrequiredOne of
"wave" "chase" "pulse" "sparkle" "fill" "breathe" "gradient"axisstringOne of
"along" "x" "y" "around" "centre"Default
"along"drivestringWhat moves it.
One of
"beat" "kick" "bass" "loud" "time"Default
"beat"tagstringOne of
"calm" "build" "drop" "home"Default
"drop"colors"palette" | string[]palette, or two colours.
speednumberDefault
10.1 to 8widthnumberDefault
0.150.01 to 1cyclesnumberDefault
10.25 to 8bgnumberBackground glow.
Default
0.050 to 0.5Responses
200OKapplication/json
idstringrequiredu-…
namestringUp to 40 characters
patternstringrequiredOne of
"wave" "chase" "pulse" "sparkle" "fill" "breathe" "gradient"axisstringOne of
"along" "x" "y" "around" "centre"Default
"along"drivestringWhat moves it.
One of
"beat" "kick" "bass" "loud" "time"Default
"beat"tagstringOne of
"calm" "build" "drop" "home"Default
"drop"colors"palette" | string[]palette, or two colours.
speednumberDefault
10.1 to 8widthnumberDefault
0.150.01 to 1cyclesnumberDefault
10.25 to 8bgnumberBackground glow.
Default
0.050 to 0.5400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X POST 'http://localhost:8080/api/custom-effects' \
-H 'content-type: application/json' \
-d '{
"name": "Pink chase",
"pattern": "chase",
"axis": "along",
"drive": "kick",
"tag": "drop",
"colors": [
"#ff0066",
"#00ccff"
],
"speed": 2,
"width": 0.1
}'const res = await fetch("http://localhost:8080/api/custom-effects", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"name": "Pink chase",
"pattern": "chase",
"axis": "along",
"drive": "kick",
"tag": "drop",
"colors": [
"#ff0066",
"#00ccff"
],
"speed": 2,
"width": 0.1
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/custom-effects",
json={
"name": "Pink chase",
"pattern": "chase",
"axis": "along",
"drive": "kick",
"tag": "drop",
"colors": [
"#ff0066",
"#00ccff"
],
"speed": 2,
"width": 0.1
},
)
print(res.json())Response
{
"id": "u-k3j9q2",
"name": "Pink chase",
"tag": "drop",
"pattern": "chase",
"axis": "along",
"drive": "kick",
"colors": [
"#ff0066",
"#00ccff"
],
"speed": 2,
"width": 0.1,
"bg": 0.05,
"cycles": 1
}{
"error": "Pattern is one of: wave, chase, pulse, sparkle, fill, breathe, gradient"
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}