user.set_password
=================

Set the password of the specified ``username`` to the ``new_password`` specified in payload.

A JSON-RPC ``error`` response (code ``-32602``, *Invalid params*) is returned in the following situations:

- the user does not exist
- the account is not local to the NAS (Active Directory, LDAP, etc.)
- the account has password authentication disabled
- the account is locked

.. note::

    When the authenticated session has less than the ``FULL_ADMIN`` role, password changes
    will be rejected if the payload does not match the currently-authenticated user. Users
    authenticated with a one-time password are exempt and may change the password without
    submitting it a second time.

.. raw:: html

    <div id="json-schema">
    <span class="badge badge-dark value-type">Type: object</span><br/>
    <div class="accordion" id="accordionCall_parameters">
    <div class="card">
    <div class="card-header" id="headingCall_parameters">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters" data-toggle="collapse" onclick="setAnchor('#Call_parameters')" type="button"><span class="property-name">Call parameters</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters" class="collapse property-definition-div" data-parent="#accordionCall_parameters" id="Call_parameters">
    <div class="card-body pl-5">
    <span class="badge badge-dark value-type">Type: array</span><br/>
    <span class="badge badge-info no-additional">No Additional Items</span><h4>Tuple Validation</h4>
    <h5>Parameter 1: set_password_data</h5>
    <div class="card">
    <div class="card-body items-definition" id="Call_parameters_items_i0">
    <h4>set_password_data</h4><span class="badge badge-dark value-type">Type: object</span><br/>
    <span class="description"><p>UserSetPasswordArgs parameters.</p>
    </span> <span class="badge badge-info no-additional">No Additional Properties</span>
    <div class="accordion" id="accordionCall_parameters_items_i0_username">
    <div class="card">
    <div class="card-header" id="headingCall_parameters_items_i0_username">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters_items_i0_username" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_username" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_username')" type="button"><span class="property-name">username</span> <span class="badge badge-warning required-property">Required</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters_items_i0_username" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_username" id="Call_parameters_items_i0_username">
    <div class="card-body pl-5">
    <h4>Username</h4><span class="badge badge-dark value-type">Type: string</span><br/>
    <span class="description"><p>Username of the account to change password for.</p>
    </span>
    </div>
    </div>
    </div>
    </div>
    <div class="accordion" id="accordionCall_parameters_items_i0_old_password">
    <div class="card">
    <div class="card-header" id="headingCall_parameters_items_i0_old_password">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters_items_i0_old_password" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_old_password" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_old_password')" type="button"><span class="property-name">old_password</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters_items_i0_old_password" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_old_password" id="Call_parameters_items_i0_old_password">
    <div class="card-body pl-5">
    <h4>Old Password</h4> <span class="badge badge-success default-value">Default: ""</span><br/>
    <span class="description"><p>Current password for verification. <code>null</code> if changing password as administrator.</p>
    </span><div class="any-of-value" id="Call_parameters_items_i0_old_password_anyOf"><h2 class="handle">
    <label>Any of</label>
    </h2><ul class="nav nav-tabs" id="tabsCall_parameters_items_i0_old_password_anyOf_anyOf" role="tablist"><li class="nav-item">
    <a class="nav-link active anyOf-option" data-toggle="tab" href="#tab-pane_Call_parameters_items_i0_old_password_anyOf_i0" id="Call_parameters_items_i0_old_password_anyOf_i0" onclick="setAnchor('#Call_parameters_items_i0_old_password_anyOf_i0')" role="tab">Option 1</a>
    </li><li class="nav-item">
    <a class="nav-link anyOf-option" data-toggle="tab" href="#tab-pane_Call_parameters_items_i0_old_password_anyOf_i1" id="Call_parameters_items_i0_old_password_anyOf_i1" onclick="setAnchor('#Call_parameters_items_i0_old_password_anyOf_i1')" role="tab">Option 2</a>
    </li></ul>
    <div class="tab-content card"><div class="tab-pane fade card-body active show" id="tab-pane_Call_parameters_items_i0_old_password_anyOf_i0" role="tabpanel">
    <span class="badge badge-dark value-type">Type: string</span><br/>
    </div><div class="tab-pane fade card-body" id="tab-pane_Call_parameters_items_i0_old_password_anyOf_i1" role="tabpanel">
    <span class="badge badge-dark value-type">Type: null</span><br/>
    </div></div></div>
    </div>
    </div>
    </div>
    </div>
    <div class="accordion" id="accordionCall_parameters_items_i0_new_password">
    <div class="card">
    <div class="card-header" id="headingCall_parameters_items_i0_new_password">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters_items_i0_new_password" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_new_password" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_new_password')" type="button"><span class="property-name">new_password</span> <span class="badge badge-warning required-property">Required</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters_items_i0_new_password" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_new_password" id="Call_parameters_items_i0_new_password">
    <div class="card-body pl-5">
    <h4>New Password</h4><span class="badge badge-dark value-type">Type: string</span><br/>
    <span class="description"><p>New password to set for the user account.</p>
    </span>
    <p><span class="badge badge-light restriction min-length-restriction" id="Call_parameters_items_i0_new_password_minLength">Must be at least <code>1</code> characters long</span></p>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div class="accordion" id="accordionReturn_value">
    <div class="card">
    <div class="card-header" id="headingReturn_value">
    <h2 class="mb-0">
    <button aria-controls="Return_value" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value" data-toggle="collapse" onclick="setAnchor('#Return_value')" type="button"><span class="property-name">Return value</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingReturn_value" class="collapse property-definition-div" data-parent="#accordionReturn_value" id="Return_value">
    <div class="card-body pl-5">
    <h4>Result</h4><span class="badge badge-dark value-type">Type: null</span><br/>
    <span class="description"><p>Returns <code>null</code> on successful password change.</p>
    </span>
    </div>
    </div>
    </div>
    </div>
    </div><br><br>

*Required roles:* 

