WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function restores a configuration backup file via HTTP POST method. If the backup file does not contain any changes, the system does not write to the configuration file.
Note:
The format for this command line example differs from our standard format because the function only accepts an HTTP POST request. For more information about how to call this request method, read Mozilla's POST documentation.
The configuration file data, in multipart/form-data format.
Note:
When you call this function on the command line, you must provide the configuration file's filepath. For example, you would use the 'file=@/var/cpanel/cpanel.config' parameter structure to call this function.
The configuration module's name.
Basic— The Basic WebHost Manager Setup configuration.Main— The Tweak Settings configuration.
Important:
This parameter is case-sensitive. You must enter the parameter in the correct case format; otherwise, the function will fail.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/restore_config_from_upload
- A server running WHM.
https://whm-server.tld:2087/json-api/restore_config_from_upload
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/restore_config_from_upload \
-H 'Content-Type: multipart/form-data' \
-F 'file=#### NOTICE ####
# After manually editing any configuration settings in this file,
# please run '\''/usr/local/cpanel/scripts/restartsrv_cpsrvd'\'' or
# '\''service cpanel restart'\'' to fully update your server'\''s configuration.
RS=jupiter
VFILTERDIR=/etc/vfilters
access_log=/usr/local/cpanel/logs/access_log
account_login_access=owner_root
adminuser=cpanel
allow_deprecated_accesshash=0
allow_login_autocomplete=1
allow_server_info_status_from=
allow_weak_checksums=0
allowcpsslinstall=1
allowparkhostnamedomainsubdomains=0
allowparkonothers=0
allowremotedomains=0
allowresellershostnamedomainsubdomains=0
allowunregistereddomains=1
allowwhmparkonothers=0
alwaysredirecttossl=1
apache_port=0.0.0.0:80
apache_ssl_port=0.0.0.0:443
api_shell=1
autocreateaentries=1
autodiscover_host=cpanelemaildiscovery.cpanel.net
autodiscover_mail_service=imap
autodiscover_proxy_subdomains=0
autoupdate_certificate_on_hostname_mismatch=1
awstatsbrowserupdate=0
awstatsreversedns=0
basename=cpanel
bind_deferred_restart_time=2
blockcommondomains=1
bwcycle=2
cgihidepass=1
check_zone_owner=1
check_zone_syntax=1
chkservd_check_interval=300
chkservd_hang_allowed_intervals=2
chkservd_plaintext_notify=0
cluster_autodisable_threshold=10
cluster_failure_notifications=1
conserve_memory=0
cookieipvalidation=strict
coredump=0
cpaddons_adminemail=
cpaddons_autoupdate=1
cpaddons_max_moderation_req_all_mod=99
cpaddons_max_moderation_req_per_mod=99
cpaddons_moderation_request=0
cpaddons_no_3rd_party=0
cpaddons_no_modified_cpanel=1
cpaddons_notify_owner=1
cpaddons_notify_root=1
cpaddons_notify_users=Allow users to choose
cpanel_locale=
cpredirect=Origin Domain Name
cpredirectssl=SSL Certificate Name
cpsrvd-domainlookup=0
create_account_dkim=1
create_account_spf=1
cycle_hours=24
database_prefix=1
debughooks=0
default_archive-logs=1
default_login_theme=cpanel
default_pkg_bwlimit=1048576
default_pkg_max_emailacct_quota=1024
default_pkg_quota=10240
default_remove-old-archived-logs=1
defaultmailaction=localuser
disable-php-as-reseller-security=0
disablequotacache=0
disk_usage_include_mailman=1
disk_usage_include_sqldbs=1
display_cpanel_doclinks=0
dnsadmin_log=0
dnsadmin_verbose_sync=0
dnsadminapp
dnslookuponconnect=0
docroot=/usr/local/cpanel/base
domainowner_mail_pass=0
dormant_services=cpdavd,cphulkd,cpsrvd,dnsadmin,spamd
dumplogs=1
email_account_quota_default_selected=userdefined
email_account_quota_userdefined_default_value=1024
email_outbound_spam_detect_action=noaction
email_outbound_spam_detect_enable=1
email_outbound_spam_detect_threshold=500
email_send_limits_count_mailman=0
email_send_limits_defer_cutoff=125
email_send_limits_max_defer_fail_percentage
email_send_limits_min_defer_fail_to_trigger_protection=5
emailarchive=0
emailpasswords=0
emailsperdaynotify
emailusers_diskusage_critical_contact_admin=1
emailusers_diskusage_critical_percent=90.0000
emailusers_diskusage_full_contact_admin=1
emailusers_diskusage_full_percent=98.0000
emailusers_diskusage_warn_contact_admin=0
emailusers_diskusage_warn_percent=80.0000
emailusers_mailbox_critical_percent=90.0000
emailusers_mailbox_full_percent=98.0000
emailusers_mailbox_warn_percent=80.0000
emailusersbandwidthexceed=0
emailusersbandwidthexceed70=0
emailusersbandwidthexceed75=0
emailusersbandwidthexceed80=1
emailusersbandwidthexceed85=0
emailusersbandwidthexceed90=0
emailusersbandwidthexceed95=0
emailusersbandwidthexceed97=0
emailusersbandwidthexceed98=0
emailusersbandwidthexceed99=0
empty_trash_days=disabled
enable_piped_logs=1
enablecompileroptimizations=0
enablefileprotect=1
engine=cpanel
enginepl=cpanel.pl
engineroot=/usr/local/cpanel
exim-retrytime=15
exim_retention_days=10
eximmailtrap=1
extracpus=0
file_upload_max_bytes
file_upload_must_leave_bytes=5
file_usage=0
ftpquotacheck_expire_time=30
ftpserver=pure-ftpd
gzip_compression_level=6
gzip_pigz_block_size=4096
gzip_pigz_processes=1
htaccess_check_recurse=2
httpd_deferred_restart_time=0
invite_sub=1
ionice_bandwidth_processing=6
ionice_cpbackup=6
ionice_dovecot_maintenance=7
ionice_email_archive_maintenance=7
ionice_ftpquotacheck=6
ionice_log_processing=7
ionice_quotacheck=6
ionice_userbackup=7
ionice_userproc=6
ipv6_control=0
ipv6_listen=0
jailapache=0
jaildefaultshell=0
jailmountbinsuid=0
jailmountusrbinsuid=0
jailprocmode=mount_proc_jailed_fallback_full
keepftplogs=0
keeplogs=0
keepstatslog=0
loadthreshold
local_nameserver_type=bind
log_successful_logins=0
logchmod=0640
logout_redirect_url=
mailbox_storage_format=maildir
mailserver=dovecot
maintenance_rpm_version_check=1
maintenance_rpm_version_digest_check=1
maxcpsrvdconnections=200
maxemailsperhour
maxmem=768
min_time_between_apache_graceful_restarts=10
minpwstrength=0
modsec_keep_hits=7
mycnf_auto_adjust_innodb_buffer_pool_size=0
mycnf_auto_adjust_maxallowedpacket=1
mycnf_auto_adjust_openfiles_limit=1
myname=cpaneld
mysql-host=localhost
mysql-version=5.5
mysqldebug=0
nobodyspam=1
nocpbackuplogs=0
nosendlangupdates=0
notify_expiring_certificates=1
numacctlist=30
overwritecustomproxysubdomains=0
overwritecustomsrvrecords=0
permit_appconfig_entries_without_acls=0
permit_appconfig_entries_without_features=0
permit_unregistered_apps_as_reseller=0
permit_unregistered_apps_as_root=0
php_max_execution_time=90
php_memory_limit=128
php_post_max_size=55
php_system_default_version=ea-php56
php_upload_max_filesize=50
phploader=
phpopenbasedirhome=0
pma_disableis=0
popbeforesmtp=0
popbeforesmtpsenders=0
postgresdebug=0
product=cPanel
proxysubdomains=1
proxysubdomainsfornewaccounts=1
proxysubdomainsoverride=1
publichtmlsubsonly=1
query_apache_for_nobody_senders=1
referrerblanksafety=0
referrersafety=0
remotewhmtimeout=35
repquota_timeout=60
requiressl=0
resetpass=1
resetpass_sub=1
root=/usr/local/cpanel
rotatelogs_size_threshhold_in_megabytes=300
roundcube_db=sqlite
rpmup_allow_kernel=0
selfsigned_generation_for_bestavailable_ssl_install=1
send_error_reports=1
send_server_configuration=1
send_server_usage=1
server_locale=en
show_reboot_banner=1
showwhmbwusageinmegs=0
signature_validation=Release and Development Keyrings
skip_chkservd_recovery_notify=0
skipanalog=0
skipapacheclientsoptimizer=0
skipawstats=0
skipboxcheck=1
skipboxtrapper=0
skipbwlimitcheck=0
skipchkservd=0
skipcpbandwd=0
skipdiskcheck=0
skipdiskusage=0
skipeximstats=0
skiphttpauth=1
skipjailmanager=0
skipmailauthoptimizer=0
skipmailman=0
skipmodseclog=0
skipnotifyacctbackupfailure=0
skipoomcheck=0
skipparentcheck=1
skiprecentauthedmailiptracker=0
skiproundcube=0
skipspamassassin=0
skipspambox=1
skipsqmail=0
skiptailwatchd=0
skipwebalizer=0
smtpmailgidonly=1
ssh_host_key_checking=0
stats_log=/usr/local/cpanel/logs/stats_log
statsloglevel=1
statthreshhold=256
system_diskusage_critical_percent=92.5500
system_diskusage_warn_percent=82.5500
tcp_check_failure_threshold=3
transfers_timeout=1800
tweak_unset_vars=
upcp_log_retention_days=45
update_log_analysis_retention_length=90
use_apache_md5_for_htaccess=1
use_information_schema=1
useauthnameservers=1
usemailformailmanurl=0
usemysqloldpass=0
userdirprotect=1
verify_3rdparty_cpaddons=0
version=3.4
xframecpsrvd=0
enable_api_log=0' \
-F module=Main{ "metadata": { "command": "restore_config_from_upload", "reason": "OK", "result": 1, "version": 1 } }
Request
This function updates the username or remote access key for a cluster server.
Important:
If you log in to a configuration cluster server that is not the parent server, nothing will indicate that the server is part of a configuration cluster. You can only view and modify this information from the master server.
We recommend that you run this function as a
POSTrequest with SSL enabled:- The length of the remote access key may cause problems if you run the function with the
GETmethod (for example, a URL in your browser). - You risk security problems if you enter a remote access key through the
GETmethod.
- The length of the remote access key may cause problems if you run the function with the
The remote configuration cluster server's name or IP address.
The new remote access key. If you do not specify a value, the function does not update the remote access key.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/update_configclusterserver
- A server running WHM.
https://whm-server.tld:2087/json-api/update_configclusterserver
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/update_configclusterserver?name=example.com&key=d0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0%3Ad0&user=root'{ "metadata": { "command": "update_configclusterserver", "name": "example.com", "reason": "OK", "result": 1, "signature": "d0:d0:d0:d0:d0:d0:d0:d0:d0:d0:d0:d0:d0:d0:d0:d0", "user": "root", "version": 1 } }