I’d like my Strapi back-office users to be able to register through a form, to then be able to login to the Strapi admin panel as Authors (after they are validated by a super admin). My problem is I can’t find any documentation about an API endpoint allowing me to create new admin users.
When I create a user via the admin panel, I can see it’s hitting the /api/users endpoint, but I don’t know how to send my POST request to make it work (I have a “Missing or invalid credentials” right now). Is it even possible to create admin users through the API ?
Thank you Eventyret for the answer and for the welcoming.
After further research, it seems that the API endpoint exists: /admin/register
My concern now is that is I don’t know what to provide. It seems the endpoint is expecting a newUser object with firstname and password, which is ok. But it also needs a registrationToken that I don’t know how to generate. When I try some random string, I get an error with “Invalid registration info” message.
I tried to find the guide you’re talking about on discord and the forum, with no success
If there is no documentation about it then it seems it was aimed to not be reached by anyone but the Strapi itself, in this case you will require to learn it by yourself.
Note: I quickly copy & pasted code-blocks of my strapi-plugin-init-admin-user - if these code-snippets are not helpful enough: I invite you to take look into it’s code.
Thank you for the hint, I’m indeed able to create new admin users programmatically with this code through a custom API endpoint controller. I’ll go deeper into strapi-plugin-init-admin-user to see how it works.