Description

This function forces a user to change the account password after the next login attempt.

This function does not change the account's password. It only forces the user to change the account password at the next login attempt. 

Examples


https://hostname.example.com:2087/cpsess##########/json-api/forcepasswordchange?api.version=1&users_json=%7B%22user1%22%3A1%2C%22user2%22%3A1%2C%22user3%22%3A1%7D%0A&stop_on_failure=1
https://hostname.example.com:2087/cpsess##########/xml-api/forcepasswordchange?api.version=1&users_json=%7B%22user1%22%3A1%2C%22user2%22%3A1%2C%22user3%22%3A1%7D%0A&stop_on_failure=1
whmapi1 forcepasswordchange users_json=%7B%22user1%22%3A1%2C%22user2%22%3A1%2C%22user3%22%3A1%7D stop_on_failure=1

{
  "data": {
    "updated": [
      "user"
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "forcepasswordchange"
  }
}
<result>
    <data>
        <updated>user</updated>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>forcepasswordchange</command>
    </metadata>
</result>

   

Parameters

ParameterTypeDescriptionPossible valuesExample

users_json

string

Required

The list of users. The system will force each user that you specify to change their account's password the next time that they log in.

A JSON-formatted list of one or more users, where each username is a named parameter with a value of 1.

For example, to force a password change for the user1, user2, and user3 accounts, use the following string: {"user1":1,"user2":1,"user3":1}

{"user1":1,"user2":1,"user3":1}
stop_on_failureBoolean

Whether to halt the function if it experiences an error.

This parameter defaults to 0.

  • 1 — Halt on error.
  • 0 — Continue on error.
1

Returns

ReturnTypeDescriptionPossible valuesExample
updatedarrayAn array of usernames that the system will force to change their passwords.One or more valid usernames.user