Child pages
  • WHM API 1 Functions - twofactorauth_remove_user_config
Skip to end of metadata
Go to start of metadata

 

Description

This function removes the Two-Factor Authentication (2FA) settings for one or more specified user accounts.

Note:

If you remove the 2FA settings for an account, the user must perform the setup procedure again to re-configure 2FA on the account.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/twofactorauth_remove_user_config?api.version=1&user=example
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/twofactorauth_remove_user_config?api.version=1&user=example
 Command Line
whmapi1 twofactorauth_remove_user_config user=example


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{  
   "data":{  
      "users_modified":[  
         "example"
      ],
      "failed":{  

      }
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"twofactorauth_remove_user_config"
   }
}
 Output (XML)
<result>
    <data>
        <users_modified>example</users_modified>
        <failed/>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>twofactorauth_remove_user_config</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The account's username.

Note:

To remove multiple users, increment the parameter name. For example, user-1user-2, or user-3.

A valid string.example

Returns

Return

TypeDescriptionPossible valuesExample

users_modified

array

An array of the user accounts for which you successfully removed 2FA settings.

 

A valid array of cPanel account names.

example

failed

hash

A hash of the user accounts for which removal failed.

 

This hash includes the username return.

 

username*

string

The reason for the failure.

Note:

The user's name is the return name.

The function returns this value in the failed hash.

A valid string.You are not authorized to modify “example”