Skip to content

Change password ​

Changes the account password when you know the current one.

POST /api/v1/auth/change-password

Body ​

FieldTypeRequiredDescription
current_passwordstringYesThe password in use now.
passwordstringYesThe new password. At least 8 characters.
password_confirmationstringYesThe new password again. Must match password.

Example ​

bash
curl -X POST https://app.xash.co.zw/api/v1/auth/change-password \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"current_password":"OLD_PASSWORD","password":"NEW_PASSWORD","password_confirmation":"NEW_PASSWORD"}'

Response 200 ​

json
{
  "success": true,
  "message": "Password changed successfully."
}

All session tokens are deleted, including the one used for this request if it was a session token. Sign in again to get a new one. Server tokens keep working.

Errors ​

StatusWhenBody
422current_password is wrong.{"success": false, "message": "Current password is incorrect."}
422The new password is too short or the confirmation does not match.Validation error

If you have forgotten the current password, see Forgotten password.