Disable API to stop spammers

I’m running the latest version of Rocket chat and my site is continuously getting spammed. I suspect the bots join through the API.

Is there a way to disable the API endpoints to stop the spammers?