# Admin API trying /nodes/:module to disable/enable node

**URL:** <https://discourse.nodered.org/t/admin-api-trying-nodes-module-to-disable-enable-node/96544>\
**Category:** General\
**Created:** [13 April 2025 08:03 UTC](https://discourse.nodered.org/t/admin-api-trying-nodes-module-to-disable-enable-node/96544 "2025-04-13T08:03:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [13 April 2025 08:03 UTC](https://discourse.nodered.org/t/admin-api-trying-nodes-module-to-disable-enable-node/96544/1 "2025-04-13T08:03:28Z")

</div>

Hi,  
I must be blind or missing some essentials....  
In the flow example below I try to disable the node but I do just get 400 as respond.

Getting the node information using GET works. Also the PUT "seems to work" when {"enabled":true} but there is in fact no change to the node even though the response is 200

The PUT method with the same msg structure fails when set to {"enabled":false}

Any hints are highly appreciated. Maybe I have misunderstod how this API call is ment to work??

NR version 4.0.5

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/5/e50e18bdbc694b8acad0687971e6e1d50414c59f.png)

```auto
[{"id":"97df91b22e59a2cf","type":"inject","z":"a6054234d3c15b43","name":"GET","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":240,"y":160,"wires":[["3395c0d386fc8989"]]},{"id":"88feaf9fbec3d558","type":"http request","z":"a6054234d3c15b43","name":"","method":"use","ret":"txt","paytoqs":"query","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":610,"y":160,"wires":[["6ecb55d63b6020f7"]]},{"id":"6ecb55d63b6020f7","type":"debug","z":"a6054234d3c15b43","name":"debug 388","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":160,"wires":[]},{"id":"3395c0d386fc8989","type":"function","z":"a6054234d3c15b43","name":"function 18","func":"msg.url = \"http://localhost:1880/nodes/node-red-node-suncalc\"\nmsg.payload.method = \"GET\"\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":160,"wires":[["88feaf9fbec3d558"]]},{"id":"83b331dca386e091","type":"sunrise","z":"a6054234d3c15b43","name":"","lat":"65","lon":"18","start":"sunrise","end":"sunset","soff":0,"eoff":0,"sendAtStartup":false,"x":260,"y":90,"wires":[[],[]]},{"id":"c1e71a8f07c622ad","type":"inject","z":"a6054234d3c15b43","name":"PUT","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":240,"y":230,"wires":[["0e00a4612dfb5936"]]},{"id":"b0aff947cd22449a","type":"http request","z":"a6054234d3c15b43","name":"","method":"use","ret":"txt","paytoqs":"query","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":610,"y":230,"wires":[["41faaa04dc1e642e"]]},{"id":"41faaa04dc1e642e","type":"debug","z":"a6054234d3c15b43","name":"debug 389","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":230,"wires":[]},{"id":"0e00a4612dfb5936","type":"function","z":"a6054234d3c15b43","name":"function 19","func":"msg.url = \"http://localhost:1880/nodes/node-red-node-suncalc\"\nmsg.method = \"PUT\"\nmsg.headers = {\"Content-type\":\"application/json\"}\nmsg.payload = {\n \"enabled\": true\n}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":230,"wires":[["b0aff947cd22449a","cf6c06b0999c78d5"]]},{"id":"cf6c06b0999c78d5","type":"debug","z":"a6054234d3c15b43","name":"debug 390","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":610,"y":300,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [13 April 2025 09:05 UTC](https://discourse.nodered.org/t/admin-api-trying-nodes-module-to-disable-enable-node/96544/2 "2025-04-13T09:05:22Z")

</div>

Did you reload your browser after your PUT request?

There must be another reason but this will ensure that the editor is in a clean state.

Andy's answer is indeed correct, you cannot disable a node that is in use.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [13 April 2025 09:06 UTC](https://discourse.nodered.org/t/admin-api-trying-nodes-module-to-disable-enable-node/96544/3 "2025-04-13T09:06:50Z")

</div>

> [@krambriw](#):
>
> I try to disable the node but I do just get 400 as respond

possibly you get a 400 Bad Request error because you have al least one node in the flow.  
from what i understand this api disables or enables the whole module .. not the specific instance of the node in a flow. and if it's in use you cannot (400).

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [13 April 2025 10:49 UTC](https://discourse.nodered.org/t/admin-api-trying-nodes-module-to-disable-enable-node/96544/4 "2025-04-13T10:49:16Z")

</div>

Thank you very much guys!!  
That was it, I acrually have one instance of the node running in the flow. Then I have to keep on using the api /flow as I already do and that works ok. I just thought that was a bit "overkill" since it is just one particular node I want to disable/enable to let it initiate itself again. I now realize that the api call is not acting on a running instance of a node but on the available collection in the palette. Is a pity, I think such an api call, acting on a running instance of a node, would be "nice to have"

Kind regards, Walter

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 July 2025 10:49 UTC](https://discourse.nodered.org/t/admin-api-trying-nodes-module-to-disable-enable-node/96544/5 "2025-07-12T10:49:24Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
