Grant type for create user

Hey ,
I have been trying to use auth0 api v2 to create users . Here is my sample request
curl -X POST -H "Authorization: Bearer " -H "Content-Type: application/json" -d '{"email":"","phone_number":"+199999999999999","user_metadata":{},"blocked":false,"email_verified":false,"phone_verified":false,"app_metadata":{},"given_name":"John","family_name":"Doe","name":"John Doe","nickname":"Johnny","picture":"","user_id":"","connection":"Initial-Connection","password":"secret","verify_email":false,"username":"johndoe"}' ""

but I am continuously getting error Insufficient scope, expected any of: create:users . I generated bearer token using client_credentials grant type but it seems like it is not working

Hi @obi ,
It appears you are FE …

Did you call-1 return the access_token along with sufficient scope ( create user) .

In order to add/create a new user you need to make to calls :

  1. (POST)
    Request Data :

Response :
“access_token”: “data”,
“scope”: "read:client_grants create:client_grants delete:client_grants update:client_grants read:users update:users delete:users create:users read:users_app_metadata update:users_app_metadata delete:users_app_metadata create:users_app_metadata ",
“expires_in”: 86400,
“token_type”: “Bearer”
NOW use the " access_token " (in header) to call : (POST)
Request Data :
“connection”: “Username-Password-Authentication”,
“email”: “”,
“password”: “SOME_PWD”,
“user_metadata”: {
“name” : “John Doe”
“email_verified”: false,
“verify_email”: false,
“app_metadata”: {}

In Response , you will get the user-obj back .

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.