How to alert when server down

I have an API and I created an endpoit called ApiStatus that returns a HTTP 200 status code. I want to creat an alert rule that sends me an email whenever the status code is not received, timeout or diferent than 200. Can anyone help me?