Struggling with Nanoleaf Shapes Custom Effects via API (HTTP 400 Error) – Need Help

Started by SamNL

SamNL

Hi everyone,

I’m trying to send custom effects to my Nanoleaf Shapes via the local API, but I keep getting a 400 Bad Request response. Here’s my situation:

  • Device/Model: Nanoleaf Shapes (Firmware 12.0.0)
  • API Endpoint: PUT /api/v1/<auth_token>/effects
  • Headers: Content-Type: application/json
  • Body: JSON with "write": { ... } specifying custom animData (either RGB or HSB).

My goal in the end is to create a progressbar-like effect with 15 Shapes for Shopify-orders that fills up during the day. I'll figure all the steps that require that out later, first just creating a gradient with 7 Shapes.

What I’ve Tried

  1. Single panel test: Attempted sending a minimal “1 panel” JSON body with either rgb or hsb colorType — still getting 400.
  2. Multiple panels: Tried listing all 7 illuminated panels (skipping the controller with ID=0) in the animData string, using both "animType":"custom" and "animType":"static" — same 400 error.
  3. Adding palette: Included a palette array in the JSON, just in case the firmware expects it — no improvement.
  4. Replacing transitionTime: Used 0, 1, or -1 for transitionTime, verifying if that changes anything — no luck.
  5. Checked basic calls:
    • GET /panelLayout/layout works fine and returns the correct panel IDs.
    • PUT /api/v1/<token>/state {"on": {"value": true}} works (returns 204, turns the panels on).
    • GET /api/v1/<token>/state returns valid state data.
    • Only the /effects PUT with animData keeps giving me 400.

Sample JSON Body (one of many variations):

 1{
 2  "write": {
 3    "command": "display",
 4    "animName": "AllGreen",
 5    "animType": "custom",
 6    "colorType": "rgb",
 7    "loop": false,
 8    "animData": "1 23855 0 255 0 1"
 9  }
10}

Or (for multiple panels):

 1{
 2  "write": {
 3    "command": "display",
 4    "animName": "GreenToOff",
 5    "animType": "custom",
 6    "colorType": "hsb",
 7    "loop": false,
 8    "animData": "7 23855 120 100 100 1 55920 120 100 90 1 ... 47664 120 100 0 1"
 9  }
10}

I’ve tried all these variations, but always get a 400 error specifically on the /effects endpoint.


Questions:

  1. Why might the Nanoleaf return a 400 for these valid-looking requests?
  2. Is there a different format or required field for Shapes firmware v12.0.0 that we’re missing?
  3. Do I need a different "command" value or a different "animType" for custom static effects?
  4. Is there an up-to-date official doc that shows the exact JSON keys needed for Shapes specifically on 12.0.0?

Any help would be hugely appreciated! Thanks in advance.

SamNL

UPDATE: this seems to be working now:

 1{
 2  "write": {
 3    "command": "display",
 4    "animType": "static",
 5    "animData": "7 23855 1 0 255 0 0 10 55920 1 0 255 0 0 10 13843 1 0 255 0 0 10 14640 1 0 255 0 0 10 57582 1 0 51 0 0 10 64507 1 0 0 0 0 10 47664 1 0 0 0 0 10",
 6    "loop": false,
 7    "palette": []
 8  }
 9}

While that is nice, could you maybe explain what I was doing wrong?

Thanks!

bold__thunder__959

Hello SamNL, I have similar problems with my Shapes Mini Triangle and get a 422 error on the API call when I work with the “animdata”. Which version of the shapes do you have exactly? The API documentation is unfortunately not accurate in my opinion.