How to know when the system needs to be rebooted when updating core20 snap?

Hi, I want to be able to monitor when the system is required to reboot and send the signal for reboot myself after shutting down all my snaps.

When snaps like core20 , snapd requires an update they require a reboot. How do I know that when it is requesting a reboot? i tried getting the info from "/changes " endpoint, but it does not give an output when the reboot message is being broadcasted.