I was trying to add user under the section of "Who can view or change this Application" by calling the addAuthorizedUser() function from rsconnect library.
I am able to configure it manually by changing the Access settings as the picture below:
However, when using the addAuthorizedUser(email = "test@gmail.com") function
throw an error of api$inviteApplicationUser stated below:
Error in api$inviteApplicationUser(application$id, validateEmail(email), :
attempt to apply non-function
The latest versions of Connect also include an officially supported API endpoint that can be used for this purpose as well: RStudio Connect API Reference