Restrict API enpoints to run from specific domain/ip only

Hello,
Is it possible to only allow the use of an endpoint from a specific domain  or ip-adres. maybe with the help of functions?

thank you
Working with APIs
4 replies