- Created by Documentation, last modified on Apr 09, 2018
Description
This function deletes a reseller and all of the reseller's cPanel accounts.
Warning:
- You cannot recover deleted accounts. Use this function with extreme caution.
- This function deletes the reseller account and all of the accounts that the reseller owns.
- To remove reseller privileges from an account but not delete the reseller's account or any accounts that the reseller owns, use the
unsetupreseller
function.
Examples
https://hostname.example.com:2087/cpsess##########/json-api/terminatereseller?user=username&terminatereseller=1&verify=I%20understand%20this%20will%20irrevocably%20remove=%20all%20the%20accounts%20owned%20by%20the%20reseller%20$resellername
https://hostname.example.com:2087/cpsess##########/xml-api/terminatereseller?user=username&terminatereseller=1&verify=I%20understand%20this%20will%20irrevocably%20remove=%20all%20the%20accounts%20owned%20by%20the%20reseller%20$resellername
whmapi0 terminatereseller user=username terminatereseller=1 verify=I understand that this will remove all of the accounts owned by the reseller username
Notes:
- You must URI-encode values.
- For more information and additional output options, read our Guide to WHM API 0 documentation or run the
whmapi0 --help
command. If you run CloudLinux™, you must use the full path of the
whmapi0
command:/usr/local/cpanel/bin/whmapi0
{ "result":[ { "status":1, "privdelete":1, "statusmsg":"Account Terminations Complete", "accts":{ "paige":{ "status":1, "statusmsg":"username account removed", "rawout":"Running pre removal script (/scripts/prekillacct)...... DoneCollecting Domain Name and IP...User: bob\nDomain: example.com\n... DoneKilling all processes owned by user......DoneCleaning passwd,shadow, group......DoneRemoving User from Group.......... DoneRemoving Web Logs......DoneRemoving Bandwidth Files...... DoneRemoving Crontab......DoneRemoving Virtual Hosts...Removed Extra Entries from httpd.conf\nexample.com not found in httpd.conf.\n... DoneRemoving MySQL databases and users......DoneRemoving PostgreSQL databases and users......DoneRemoving System User...... DoneRemoving Group......DoneRemoving DNS Entries...example.com => deleted from server. \n...DoneRemoving Email Setup...Removing /etc/valiases/example.com\n...DoneRemoving mailman lists...... DoneRemoving remotedomains,secondarymx,localdomains entries...... DoneRemoving Counter Data......DoneAdding ip back to the ip address pool... System has 2 free ips.\n...DoneRemoving user's cPanel Databases & Updating......DoneReloading Services......DoneRemoving mail and service configs...\n...DoneSending Contacts......DoneUpdating internal databases... Updating ftp passwords for username\nPurging ftp user paige\nFtp password files updated.\nFtp vhost passwords synced\n...DoneRunning post removal scripts (/scripts/legacypostkillacct, /scripts/postkillacct)......DoneAccount Removal Complete!!!...username account removed...Done" } } } ] }
<terminatereseller> <result> <accts> <name>account1</name> <rawout> Collecting Domain Name and IP...User: account1 Domain: username.tld ... Done Killing all processes owned by user......Done Cleaning passwd,shadow,group ......Done Removing User from Group..........Done Removing Web Logs......Done Removing Crontab......Done Removing Virtual Hosts...Removed Extra Entries from httpd.conf ...Done Removing System User......Done Removing Group......Done Removing DNS Entries...account1.tld -> deleted from servername. ...Done Removing Email Setup...Removing /etc/valiases/username.tld ...Done Removing mailman lists......Done Removing MySQL databases and users......Done Removing remotedomains,secondarymx,localdomains entries......Done Adding ip back to ipaddrpool...System has 0 free ips. ...Done Removing user's cPanel Databases & Updating......Done Reloading Services......DoneSending Contacts......Done Updating internal databases...Updating ftp passwords for all users Ftp password files updated. Ftp vhost passwords synced ...Done Running post removal scripts......Done <br /><b>Account Removal Complete!!!</b><br /> </rawout> <status>1</status> <statusmsg>account1 account removed</statusmsg> </accts> <accts> <name>bob</name> <rawout> Collecting Domain Name and IP...User: bob Domain: username.tld ...Done Killing all processes owned by user......Done Cleaning passwd,shadow,group......Done Removing User from Group..........Done Removing Web Logs......Done Removing Crontab......Done Removing Virtual Hosts...Removed Extra Entries from httpd.conf ...Done Removing System User......Done Removing Group......Done Removing DNS Entries......bob.tld -> deleted from servername. ...Done Unable to unlink /var/named/username.tld.db, file does not exist.bob.tld -> deleted from servername. ...Done Removing Email Setup...Removing /etc/valiases/username.tld ...Done Removing mailman lists......Done Removing MySQL databases and users...Database ``bob_db1'' dropped Database ``username'' dropped ...Done Removing remotedomains,secondarymx,localdomains entries......Done Adding ip back to ipaddrpool...System has 0 free ips. ...Done Removing user's cPanel Databases & Updating......Done Reloading Services......Done Sending Contacts......Done Updating internal databases...Updating ftp passwords for all users Ftp password files updated. Ftp vhost passwords synced ...Done Running post removal scripts......Done <br /><b>Account Removal Complete!!!</b><br /> </rawout> <status>1</status> <statusmsg>username account removed</statusmsg> </accts> <privdelete>1</privdelete> <status>1</status> <statusmsg>Account Terminations Complete</statusmsg> </result> </terminatereseller>
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
user | string | Required The reseller account's username. | A valid reseller username on the server. | username |
terminatereseller | Boolean | Required Whether to terminate the reseller's main account. |
| 1 |
verify | string | Required A verification message. | Click to view...
|
Returns
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
| array of hashes | An array of hashes of function output. | This hash includes the status , privdelete , and statusmsg returns and the accts hash. |
|
| Boolean | Whether the function succeeded. The function returns this value in the |
| 1 |
| Boolean | Whether the function deleted the reseller's main account. The function returns this value in the |
| 1 |
| string | A message of success or a reason for failure. The function returns this value in the |
|
|
| hash | A hash of termination data for the reseller's accounts. The function returns this hash in the | This hash includes the username hash, where username is a cPanel username that the reseller owned. | |
| hash | A hash of termination data for an account that the reseller owned. Note: The cPanel account name is the return's name. The function returns this hash in the | This hash includes the status , statusmsg , and rawout returns. | |
| Boolean | Whether the function succeeded. The function returns this value in the |
| 1 |
| string | A message of success or a reason for failure. The function returns this value in the |
|
|
| string | Output from the account's removal. The function returns this value in the | One or more string values. Note: This output may contain HTML. | Click to view... Collecting Domain Name and IP...User: bob Domain: username.tld ...Done Killing all processes |
Function information
API Version:
WHM API 1 Equivalent:
Important:
We strongly recommend that you use WHM API 1. WHM API 0 is deprecated.
Available in:
WHM 11+
Methods:
GET, POST
Required Parameters:
reseller
, terminatereseller
, verify
Return Formats:
About WHM API 0
Warning:
WHM API 0 is deprecated. We strongly recommend that you use the equivalent WHM API 1 function instead.
Notes:
- Some functions and parameters may require that you authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 0 Functions - acctcounts — This function lists a reseller's total accounts, suspended accounts, and account creation limit.
-
Page:WHM API 0 Functions - getresellerips — This function lists a reseller's available IP addresses.
-
Page:WHM API 0 Functions - listresellers — This function lists the reseller accounts on the server.
-
Page:WHM API 0 Functions - resellerstats — This function lists statistics for a reseller's accounts.
-
Page:WHM API 0 Functions - setresellerips — This function adds IP addresses to a reseller's account.