'Invalid property user_id' in Create a password change ticket

I tried to create a password change ticket using auth management API v2 in auth web site (and also using postman). I keep getting this error:

{
“statusCode”: 400,
“error”: “Bad Request”,
“message”: “Payload validation error: ‘Invalid property user_id’.”,
“errorCode”: “invalid_body”
}

I’m passing the data:
{

“result_url”: “my-apps.us.auth0.com/api/v2/”,
“user_id”: “auth0|user_id_code”,
“connection_id”: “con_code”,
“email”: “user.email@mydomain.com”,
“ttl_sec”: 86400,
“mark_email_as_verified”: true,
“includeEmailInRedirect”: false
}

I also tried passing the user_id without “auth0|” and as “auth0%7C” and got the same error.
I also changed the result URL to “http://localhost:3000” and got the same error.

I’m trying to create a custom page to reset the password. If there is another way, please point to me. I’m lost in the documentation.

Hi and welcome to the Auth0 Forums!

when generating a password change ticket you must use the email and connection_id , or just the user_id. You cannot use both in the payload.

The user_id should be sent with the auth0| portion, since the entire user_id contains the IDP and the ID for the user.

You can review the schema here: https://auth0.com/docs/api/management/v2#!/Tickets/post_password_change

Customizing the Auth0 Password Reset page is documented here: https://auth0.com/docs/universal-login/customize-password-reset-page

Let us know how it goes

3 Likes

Removing the user_id worked.
Now I understand why it says optional.

Thank you!

*Edited to add the data without user_id:
{
“result_url”: “http://localhost:3000”,
“connection_id”: “con_code”,
“email”: “user.email@mydomain.com”,
“ttl_sec”: 86400,
“mark_email_as_verified”: true,
“includeEmailInRedirect”: false
}

1 Like

Glad you have it working and thanks for sharing the solution @marcus.baker!

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