Allow inviting users with the API

Has been tested on staging and works.