# "Invalid property user\_id" when using tickets/password-change endpoint

**URL:** <https://community.auth0.com/t/invalid-property-user-id-when-using-tickets-password-change-endpoint/9426>\
**Category:** Get Help\
**Tags:** user\_id, tickets, password-change\
**Created:** [February 7, 2018, 1:26am UTC](https://community.auth0.com/t/invalid-property-user-id-when-using-tickets-password-change-endpoint/9426 "2018-02-07T01:26:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krasimir\_Tsonev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/krasimir_tsonev/32/11694_2.png) [@Krasimir\_Tsonev](https://community.auth0.com/u/Krasimir_Tsonev)\
**Post date:** [February 7, 2018, 1:26am UTC](https://community.auth0.com/t/invalid-property-user-id-when-using-tickets-password-change-endpoint/9426/1 "2018-02-07T01:26:24Z")

</div>

I’m using the following function to send a password reset email:

```
function passwordReset(userId, email) {
  var options = {
    method: 'POST',
    url: 'https://.../api/v2/tickets/password-change',
    headers: { authorization: 'Bearer ' + token },
    body: {
      result_url: '...',
      user_id: userId,
      new_password: 'secret',
      connection_id: '...',
      email: email,
      ttl_sec: 0
    },
    json: true
  };

  request(options, function (error, response, body) {
    if (error) throw new Error(error);

    console.log(body);
  });
}

```

I’m pretty sure that:

- The token is correct. I’m using the same one for tickets/email-verification endpoint and it works ok,
- The userId is copied from your dashboard and it works with tickets/email-verification endpoint
- I have correctly setupped a client (granted proper permissions) and connection. I got the connection id from the /connections endpoint.
- The email is also correct

Using the same token and user id I am able to use tickets/email-verification and connections endpoints.

However with tickets/password-change I’m getting the following

```
{ statusCode: 400,
  error: 'Bad Request',
  message: 'Payload validation error: \'Invalid property user_id\'.',
  errorCode: 'invalid_body' }

```

---

<div class="post-metadata">

**Author:** ![priya.sharma.9362](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/priya.sharma.9362/32/14302_2.png) [@priya.sharma.9362](https://community.auth0.com/u/priya.sharma.9362)\
**Post date:** [February 7, 2018, 6:45pm UTC](https://community.auth0.com/t/invalid-property-user-id-when-using-tickets-password-change-endpoint/9426/2 "2018-02-07T18:45:02Z")

</div>

Hi @krasimir

I tried to test the issue using postman, and yes I am also facing it.  
But as per my understanding, the error says that there is some problem with the body params and not the token.  
It states that the service doesn’t recognize user\_id as a body param.

**When I tried the same request without the user\_id field, I received the ticket positively.**  
Thus, let us wait for some experts @jmangelo to comment about this or you can continue using it excluding the user\_id field.

Thanks!

---

<div class="post-metadata">

**Author:** ![Krasimir\_Tsonev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/krasimir_tsonev/32/11694_2.png) [@Krasimir\_Tsonev](https://community.auth0.com/u/Krasimir_Tsonev)\
**Post date:** [February 7, 2018, 7:54pm UTC](https://community.auth0.com/t/invalid-property-user-id-when-using-tickets-password-change-endpoint/9426/3 "2018-02-07T19:54:25Z")

</div>

Yep, when I remove the user\_id from the request it works and that satisfies our use case. So all good for now. Thanks.

---

<div class="post-metadata">

**Author:** ![ivorscott](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ivorscott/32/17409_2.png) [@ivorscott](https://community.auth0.com/u/ivorscott)\
**Post date:** [September 16, 2020, 12:27am UTC](https://community.auth0.com/t/invalid-property-user-id-when-using-tickets-password-change-endpoint/9426/5 "2020-09-16T00:27:37Z")

</div>

Got the same issue trying to add app\_metadata for a user from my backend. The following didn’t work:

```
var jsonStr = fmt.Sprintf("{\"app_metadata\": { \"user_id\": \"%s\" }}", userId)
req, err := http.NewRequest(http.MethodPatch, urlStr, strings.NewReader(jsonStr))

```

I also received such a response:

```
{ statusCode: 400,
  error: 'Bad Request',
  message: 'Payload validation error: \'Invalid property user_id\'.',
  errorCode: 'invalid_body' }

```

I think the issue is app\_metadata can’t have properties with “\_” in the name. I removed the “user\_” and it worked.

```
var jsonStr = fmt.Sprintf("{\"app_metadata\": { \"id\": \"%s\" }}", userId)
req, err := http.NewRequest(http.MethodPatch, urlStr, strings.NewReader(jsonStr))

```

Hope this helps someone. I spent a lot of time debugging this.
