WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_remove_user_config
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_remove_user_config
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
twofactorauth_remove_user_config \
user='example.com'{ "data": { "failed": { … }, "users_modified": [ … ] }, "metadata": { "command": "twofactorauth_remove_user_config", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_set_issuer
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_set_issuer
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
twofactorauth_set_issuer \
issuer='hostname.example.com'{ "metadata": { "command": "twofactorauth_set_issuer", "reason": "OK", "result": 1, "version": 1 } }
Request
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_set_tfa_config
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_set_tfa_config
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
twofactorauth_set_tfa_config \
secret='WJ73QJSKZBXCFIPZ' \
tfa_token='227174'{ "data": { "success": 1 }, "metadata": { "command": "twofactorauth_set_tfa_config", "reason": "OK", "result": 1, "version": 1 } }