Check out this quesion talking about the node red admin api.
You can also use the SendFlow node which uses the /flows endpoint to update the node red instance it points to.