Auth0 Home Blog Docs

Additional properties not allowed - can't create user using management API

management-api
create-user
user-management

#1

Hi,

I am having difficultis in creating user using management API. This is how my curl looks like

curl -i -X POST -H 'authorization: Bearer normaly.I_have_token_here' -H "Accept: application/json" -d '{"connection":"Username-Password-Authentication"}' https://karhoo-test.eu.auth0.com/api/v2/users

and then response I am getting

{"statusCode":400,"error":"Bad Request","message":"Payload validation error: 'Additional properties not allowed: {\"connection\":\"Username-Password-Authentication\"} (consider storing them in app_metadata or user_metadata. See \"Users Metadata\" in https://auth0.com/docs/api/v2/changes for more details)'.","errorCode":"invalid_body"}

#2

Can you please post the entire request to investigate - I don’t see any email or password parameters in that CURL request.


#3

You’re sending the wrong headers, the -d options will default to sending a content type of application/x-www-form-urlencoded and you want to send JSON.

You should be also sending an additional header: -H "Content-Type: application/json"

In addition and like mentioned in the comments, you’ll need to include more than just the connection information.


#4