Change User's Password
This endpoint changes the password of the authenticated user
info
This operation requires authentication.
HTTP Request
PATCH /api/v2/user/{id}/change_password/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | A unique integer value identifying this user |
password | string | true | none | The current password |
new_password | string | true | none | The new password |
Example Body Parameters
- JSON
{
"password": "string",
"new_password": "string"
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"password": "string",
"new_password": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization: Bearer <token>'
};
fetch('/api/v2/user/{id}/change_password/',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X PATCH /api/v2/user/{id}/change_password/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
-H "Authorization: Bearer <token>"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Response status code | None |