Change my password
PUT /account/password
Changes the password you sign in with. Send your current password and a new one; the session you’re using stays signed in.
The new password has to pass this instance’s password policy, which can require a minimum length, an upper-case letter, a digit, a symbol, or not being one of a short list of very common passwords; none of these is on unless the operator turns it on, and none is applied if the policy can’t be read. Length is counted in bytes. The new password also can’t be your current one or one of the last five recorded in your password history, which may not include every earlier password.
Set revoke_other_sessions to true to also try to sign out your
other sessions. That only happens when this request uses a session
cookie: with an API token, or when the field is left out, no session
is ended. If signing them out fails, the password is still changed
and sessions_revoked is 0. API tokens are never revoked here.
A wrong current password, a password the policy rejects, or a reused
one gets a 400 that says which. So does an account with no password
of its own. A 500 doesn’t always mean nothing changed: the new
password can already be saved. The change is recorded in the audit
log as user.password_changed on a best-effort basis.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Your current password.
The new password. It’s checked against the password policy when one is set and can be read, and against your current and recently recorded passwords.
Set to true to try to end your other sessions; if that fails, the
password still changes. Leaving it out, or false, ends none. It
only has an effect when this request uses a session cookie.
Responses
Section titled “ Responses ”Password changed.
object
How many of your other sessions were ended. It’s 0 when you didn’t ask, when the request used an API token, or when ending them failed, and it can include sessions that had already expired.
Malformed request
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Unexpected server error
object
Human-readable error summary
Example
the request could not be completed