Suspend cPanel account

This function suspends an account.

SecurityBasicAuth
Request
query Parameters
user
required
string

The account to suspend.

Example: user=username
disallowun
integer
Default: 0

Whether to allow only the root user to unsuspend the account.

  • 1 - Only the root user can unsuspend the account.
  • 0 - The root user or the account's owner can unsuspend the account.
Enum: 0 1
Example: disallowun=1
leave-ftp-accts-enabled
integer
Default: 0

Whether to skip suspension of the account's FTP accounts.

  • 1 - Do not suspend the FTP accounts.
  • 0 - Suspend the FTP accounts.
Enum: 0 1
Example: leave-ftp-accts-enabled=0
reason
string
Default: "Unknown"

The reason for suspension.

Important:

We strongly recommend that you provide a reason for suspension whenever you suspend an account.

Example: reason=Nonpayment
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/suspendacct
Request samples
whmapi1 --output=jsonpretty \
  suspendacct \
  user='username'
Response samples
application/json
{
  • "metadata": {
    • "command": "suspendacct",
    • "output": {
      • "raw": "Changing Shell to /bin/false...Changing shell for username. Warning: \"/bin/false\" is not listed in /etc/shells. Shell changed. Done Locking Password...Locking password for user username. passwd: Success Done Suspending mysql users Using Universal Quota Support (quota=0) Suspending websites... Using Universal Quota Support (quota=0) Suspending FTP accounts... Updating FTP passwords for username FTP password files updated. FTP vhost passwords synced username's account has been suspended\n"
      },
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}