Return cPanel account 2FA data

This function returns the Two-Factor Authentication (2FA) configuration for a cPanel account, its email accounts, and its team user accounts.

SecurityBasicAuth
Request
query Parameters
user
required
string <username>

The username for the account.

Example: user=example
Responses
200

HTTP Request was successful.

Response Schema: application/json
object

The cPanel user account that the API was called for.

object
get/twofactorauth_get_tfa_config_for_user
Request samples
whmapi1 --output=jsonpretty \
  twofactorauth_get_tfa_config_for_user \
  user='user'
Response samples
application/json
{
  • "data": {
    • "example": {
      • "email": {
        • "user@example.com": {
          • "secret": "QLLIU5WTY3UTJGNG"
          }
        },
      • "primary_account": {
        • "secret": "QLLIU5WTY3UTJGNG"
        },
      • "team": {
        • "team_user@example": {
          • "secret": "QLLIU5WTY3UTJGNG"
          }
        }
      }
    },
  • "metadata": {
    • "command": "twofactorauth_get_tfa_config_for_user",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}