Auth0 Home Blog Docs

Error calling database sign-up with user metadata

database-connections

#1

While testing the sign-up endpoint /dbconnections/signup using Postman I’m getting error as:

{  "error": "invalid user_metadata type (expected object)" }

Below is my JSON data

{
    "client_id": "ClientId",
    "email": "ronak.sharma5248s@asd.com",
    "password": "Jambo0047",
    "connection": "Username-Password-Authentication",
    "user_metadata":"{ 'phone': '9898523236' }"
 }

If you remove user_metadata property from JSON, it works as expected.


#2

As the error states the user_metadata property should be an object and you’re currently passing a string.

Replace this (which is incorrect):

"user_metadata": "{ 'phone': '9898523236' }"

with this:

"user_metadata": { "phone": "9898523236" }

#3

hi,
for what it’s worth the example provided here is incorrect and passes the user metadata as a string: https://auth0.com/docs/api/authentication?shell#signup


#4

hi,
for what it’s worth the example provided here is incorrect and passes the user metadata as a string: https://auth0.com/docs/api/authentication?shell#signup


#5

Thanks for calling the attention to this situation; I mentioned this to the docs team so it can be addressed.


#6

@eric.barault it’s now fixed and the docs mention that this needs to be an object with some additional constraints on the actual metadata properties contained within it.


#7