Change the account password
Access: Bearer token required.
Replaces the password after checking the current one. Accounts created with Google or Apple have no password and cannot use this endpoint. On success a password_changed notification ("Password Changed") is created and delivered in-app, by push and by email according to the user's systemUpdates preferences. Existing sessions, access tokens and the refresh token are not revoked; call POST /user/logout-all-devices to do that.
A wrong current password is answered with 401. Clients that treat every 401 as an expired session should special-case this endpoint so the user is not signed out.
bearerAuthAuthorizationBearer <JWT>Access token returned by sign-in. Send it as Authorization: Bearer <token>.
application/json- body
currentPassword*stringThe password currently set on the account.
newPassword*stringThe new password, 8-128 characters.
8 <= length <= 128Password changed
application/json- response
status*integersuccess*booleanmessage*stringdata*unknowncurl -X POST 'http://localhost:4000/api/v1/user/change-password' \ -H 'Content-Type: application/json' \ -d '{ "currentPassword": "S3cure-Passw0rd", "newPassword": "N3w-S3cure-Passw0rd"}'{ "status": 200, "success": true, "message": "Password changed successfully.", "data": null}