API Call to Set Attributes

I’m using the API to load a entity with some attributes that I need to use! This works, but I was assuming that the Attributes would only be reset on HA restart… But that does not seems to be the case! I have the Attributes disappearing, even without any reboot or action to the UI. How can I ensure that the Attributes keep showing? How often do I need to submit the API?

Thank You