latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

Authentication
Two-Factor Authentication

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.

get/twofactorauth_get_tfa_config_for_user

Query parameters

userstring username required
Example:example

The username for the account.

Response

HTTP Request was successful.

{"stackTrail":"paths:/twofactorauth_get_tfa_config_for_user:get:responses:200:content:application/json:schema:properties:data","oasType":"schema","type":"unknown","description":"The cPanel user account that the API was called for.","example":{"example":{"email":{"user@example.com":{"secret":"QLLIU5WTY3UTJGNG"}},"primary_account":{"secret":"QLLIU5WTY3UTJGNG"},"team":{"team_user@example":{"secret":"QLLIU5WTY3UTJGNG"}}}}}

Example response

{
  "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
  }
}