I'm trying to add users through the REST API, but I'm getting an authentication error.
The endpoint I'm posting the new user to is
<sp_url>/_api/web/siteusers, using the pnp-js-core library. I get a 401, although my user has all privilages, except for admin privilages.
This answer mentions the fact that admin privilages resolve the issue. However, I would rather not give admin rights to every user that needs to add other users. I think it should be possible to add people through the REST API without admin privilages, as I can add users through the normal sharepoint web interface.
How can I add users through the REST API without giving the user admin privilages?