# Is there an API for changing a password?

**URL:** https://meta.discourse.org/t/is-there-an-api-for-changing-a-password/52537
**Category:** Development
**Created:** [November 5, 2016, 8:50am UTC](https://meta.discourse.org/t/is-there-an-api-for-changing-a-password/52537 "2016-11-05T08:50:21Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [November 5, 2016, 2:11pm UTC](https://meta.discourse.org/t/is-there-an-api-for-changing-a-password/52537/2 "2016-11-05T14:11:11Z")

</div>

Would sending a password reset email via the API be enough for your needs?

```plaintext
Request Url: http://localhost:3000/session/forgot_password
Request Method: POST
Form Data:
  api_key: {{api_key}}
  api_username: {{api_username}}
  login: discourse2

```

The user would then receive an email like this:

 ![](https://global.discourse-cdn.com/meta/original/3X/a/6/a6af826d2fcc8f300d73c0291cf5c80ac8536d5e.png)

that they could use to reset their password.

Other than that I don’t know how you can change the password via the API without knowing the password reset token (which is only available in that email).

But if you did happen to know the password reset token, you could make this API Call:

```plaintext
Request Url: http://localhost:3000/users/password-reset/{token}
Request Method: PUT
Form Data:
  api_key: {{api_key}}
  api_username: {{api_username}}
  username: discourse2
  password: password

```

---

_[View the full topic](https://meta.discourse.org/t/is-there-an-api-for-changing-a-password/52537)._
