Not allow rocketchat REST API

How can I only allow specified users to connect my rocketchat REST api? And not allow other users to use the api?

You can’t. Doing so would break the entire Rocket.Chat Application as the web interface relies on it and the mobile applications rely on it.