# Change password

`PUT /users/password-reset/{token}.json`

Authentication: no security requirement declared for this operation.

Parameters:

- `token` (path, string, required)
  Type: string

Request body: application/json

Type: any

- `username` (required)
  Type: string

- `password` (required)
  Type: string

Additional properties: false

Responses:

- 200: success response

## Examples

### cURL

```bash
curl -X PUT 'https://discourse.example.com/users/password-reset/string.json' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "username": "string",
  "password": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "username": "string",
  "password": "string"
}`;

const response = await fetch('https://discourse.example.com/users/password-reset/string.json', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "username": "string",
  "password": "string"
}'''

response = requests.put(
    'https://discourse.example.com/users/password-reset/string.json',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
