REST API security
REST has no built-in security features, however, there are several ways you can secure it.
Authentication
You should use a form of authentication to ensure not everyone can use the REST API.
Encryption
Communication between the client and server should be encrypted using TLS because many authentication methods don't have encryption. When an attacker intercepts the credentials, they might be able to communicate with the API.
Links
https://networklessons.com/network-automation/rest-api-authentication