"Insert for entity 'user_profile’ is not allowed" when creating users via API

Hi,

I’m using Testiny Server. I generated an API key with “Administrator” permissions. I’m now trying to create users via API. The call I’m using looks like this:

curl -L 'http://myserver:port/api/v1/user-profile' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Api-Key: my-key' \
-d '{
"email": "[email protected]",
"display_name": "Full Name",
"display_language": "en",
"is_active": true,
"is_invite_pending": true,
"data": {}
}'      

However, I get the following error:

{“type”:“ApiError”,“code”:“API_ACCESS_DENIED”,“message”:“‘Insert’ for entity ‘user_profile’ is not allowed. Make sure that you have the correct permissions for this project and that all included mapped entities belong to the same project”,“reqid”:“GwA41qmzEaljEMjI”}

Since the API token has admin permissions, I doubt it’s because of insufficient permissions. What could be the problem?

Thanks in advanced.

Kind regards

Hello Jose,

Currently creating users is not supported via API keys (you would need to use the /api/v1/signup/invite endpoint, not creating the user profile directly)

However, we will consider adding that in Testiny Server in a future release.

If you would like to invite a bunch of users, there is a bulk invite function in the user management view where you can paste a list of emails or load a CSV file.

Regards,
Michael
Testiny Team