Hi,
Generally, your REST API needs to be accessible to anyone you expect the use the User Interface. So, if your User Interface is accessible to the world, then your REST API must also be accessible to the world. If your User Interface is behind a firewall, then your REST API can be behind the same firewall (but then all users must access both from behind that firewall). Generally, it must have the exact same access settings as your User Interface, since the User Interface requires the REST API to operate.
Tim