Update 2FA authentication secret and code

This function sets the secret and the authentication code for Two-Factor Authentication (2FA) for the root or reseller account. You can generate a random secret and an OTP authentication URL with WHM API 1's twofactorauth_generate_tfa_configorauth_generate_tfa_config function.

Authorizations:
query Parameters
secret
required
string

A generated code for use with 2FA in Base32 format.

Example: secret=WJ73QJSKZBXCFIPZ
tfa_token
required
string

The time-based one-time password (TOTP) that the authentication app provides.

Example: tfa_token=227174

Responses

Response Schema: application/json
object
object

Request samples

whmapi1 --output=jsonpretty \
  twofactorauth_set_tfa_config \
  secret='WJ73QJSKZBXCFIPZ' \
  tfa_token='227174'

Response samples

Content type
application/json
{
  • "data": {
    • "success": 1
    },
  • "metadata": {
    • "command": "twofactorauth_set_tfa_config",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}