Delete reseller and reseller's cPanel accounts

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 WHM API 1 unsetupreseller function.
SecurityBasicAuth
Request
query Parameters
terminatereseller
required
integer

Whether to terminate the reseller's main account.

  • 1 — Terminate.
  • 0 — Do not terminate.
Enum: 1 0
Example: terminatereseller=1
user
required
string <username>

The reseller account's username.

Example: user=username
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/terminatereseller
Request samples
whmapi1 --output=jsonpretty \
  terminatereseller \
  user='username' \
  terminatereseller='1'
Response samples
application/json
{
  • "data": {
    • "acct": [
      • {
        • "output": {
          • "raw": "Running pre removal script (/usr/local/cpanel/scripts/prekillacct)......DoneCollecting\nDomain Name and IP...User: example Domain: example.com\n...DoneLocking account and setting shell to nologin...Locking\npassword for user example. passwd: Success ...DoneKilling\nall processes owned by user......DoneRemoving\nSessions.........DoneRemoving Suspended Info.........DoneCleaning\nVirtfs.........DoneRemoving Web Logs......DoneRemoving\nBandwidth Files......DoneRemoving Email Sending\nLimits Cache......DoneRemoving DKIM keys......DoneRemoving\nCrontab......DoneRemoving HTTP Virtual Hosts...Removed\nthe following non-SSL virtual hosts: example.com\nRemoved the following SSL virtual hosts: ...DoneRemoving\nftp Virtual Hosts......Done Removing user''''s\nweb content directory symlinks......DoneRemoving\nMySQL databases and users......DoneRemoving PostgreSQL\ndatabases and users......DoneRemoving User & Group.......Success...Done\nRemoving DNS Entries...example.com => deleted\nfrom hostname. ...Done Removing Email Setup...Removing\n/etc/valiases/example.com ...Done Removing mailman\nlists......Done Updating Databases......Done Removing\nbandwidth limits......Done Removing Counter Data......Done\nAdding IP back to the IP address pool...System\nhas 3 free ips. ...Done Removing user''''s cPanel\nDatabases & Updating......Done Reloading Services......Done\nRemoving mail and service configs... ...Done Removing\nLogaholic Webstats...Id: TQ:TaskQueue:129 ...Done\nSending Contacts......Done Updating internal databases...Updating\nftp passwords for example Purging ftp user example\nFtp password files updated. Ftp vhost passwords\nsynced ...Done Running post removal scripts (/usr/local/cpanel/scripts/legacypostkillacct,\n/usr/local/cpanel/scripts/postkillacct)......Done\nAccount Removal Complete!!!...example account\nremoved...Done\n"
          },
        • "reason": "username account removed",
        • "result": 1,
        • "user": "username"
        }
      ]
    },
  • "metadata": {
    • "command": "terminatereseller",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}