Restful sensor update an endpoint?

Hello, I have a custom sensor (open/close door) sensor i had created using an RPI 0W and when i was using smarthings i could send a restful command to smarthings to let it know if the state changed.
I know I can read the state of the sensor using a rest sensor but the question is, if i dont want to poll it like every second, is there anyway i can send a rest command to an endpoint on my HA to notify it that the state changed?
One thing that i was thinking is to convert it to a mqtt sensor and send the update like this but i would rather not make any of these changes now.

So what i need is pretty much something that when the pin state goes to 0 or 1 it will send a command to HA to let it know. For now like i said above i have it reading the state every 5 sec. BTW i want to do the same to other temperature and humidity sensors i have as well only when the value changes instead of polling it every x seconds.
Let me know if you have any examples too! Thank you

Home Assistant has a REST API:

Whatever it is you have, that must inform Home Assistant, can make an appropriate REST call.

thanks for the pointer, will read this tonight :slight_smile: