How to calculate an alert threshold to determine the availability of a server

I'd like to determine whether a server or api is up or down but to avoid false positive or generate many alerts I'd like to calculate a threshold at which an alert could be sent. So I need to check many apis with different time interval like 1mn, 5mn and 10mn. So I think the threshold depends on these time interval and frequency of down status. Thanks