Auth0 Home Blog Docs

Get the user_id with the provider on API signup

api
signup
user_id
provider

#1

Hello,

When I create a new user with /dbconnections/signup, the response contains only the short user_id :

{"_id":"5aab90daaa9ad130c17483f8","email_verified":false,"email":"myemail@gmail.com"}

How can I retrieved the user_id prefixed with the provider : auth0|5aab90daaa9ad130c17483f8?


#2

Hey @abasille :wave: The user_id you specified is actually the correct one.

Since the POST /dbconnections/signup endpoint only works on database connections, the user_id will always be of the format: auth0|{_id} where {_id} is simply the value returned by the call the /dbconnections/signup. In your example: _id = 5aab90daaa9ad130c17483f8.

You can simply append auth0| to the _id returned and you should be good to go :slight_smile:


#3

Thank you @fady for your clear and fast answer!


#4

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