Why user_id property is not allowed when creating a new user?

I deleted a connection and with it also all user related to it also were deleted. I try to restore users by creating them via Postman with same ids

    "user_id": "sms|627fa64b9cd59005b0225c40",
    "given_name": "Анна",
    "family_name": "Ромушко",
    "phone_number": "+380638916323",
    "app_metadata": {
        "documentsUploaded": true,
        "documentsChecked": true,
        "ownerId": "google-oauth2|102304051984257672435",
        "accessibleBrands": [
    "user_metadata": {
        "middleName": "Алексеевна",
        "preferredDeliverySettlementId": "e717110a-4b33-11e4-ab6d-005056801329"
    "connection": "sms"

but I always get this response:

    "statusCode": 400,
    "error": "Bad Request",
    "message": "\"user_id\" is not allowed",
    "errorCode": "invalid_body"

Documentation says that user_id is optional property in body when creating a new user.

It is very important to create user with specific user_id. What I am doing wrong?

P.S. I also tried to create user with random user_id but it also returns same response

Hi @eugene.shemonaev,

Thanks for reaching out to the Auth0 Community!

After looking closely at your request, I noticed you are creating a Passwordless SMS User with the user_id property.

Unfortunately, this is not allowed and will produce the "user_id" is not allowed error.

Generally, the user_id can be optionally passed when creating database connection users.

I hope this helps!

Please feel free to reach out if you have any additional questions.


1 Like

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