Child pages
  • WHM API 0 Functions - suspendreseller
Skip to end of metadata
Go to start of metadata

 

Description

This function suspends a reseller account.

Warning:

This function also suspends all of the cPanel accounts that the reseller owns. 

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/suspendreseller?user=username&reason=Nonpayment
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/suspendreseller?user=username&reason=Nonpayment
 Command Line
whmapi0 suspendreseller user=username reason=nonpayment 


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/api/whmapi0

 Output (JSON)
{  
   "output":"Changing Shell to /bin/false...Changing shell for username.\nWarning: \"/bin/false\" is not listed in /etc/shells.\nShell changed.\nDone\nLocking Password...Locking password for user username.\npasswd: Success\nDone\n1Suspending email account logins for username.tld .... Done\nSuspending mysql users\nUsing Universal Quota Support (quota=0)\nSuspending websites...\nUsing Universal Quota Support (quota=512000)\nSuspending FTP accounts...\nUpdating FTP passwords for username\nFTP password files updated.\nFTP vhost passwords synced\nusername's account has been suspended\n\nChanging Shell to /bin/false...Changing shell for noftp.\nWarning: \"/bin/false\" is not listed in /etc/shells.\nShell changed.\nDone\nLocking Password...Locking password for user noftp.\npasswd: Success\nDone\n1Suspending mysql users\nUsing Universal Quota Support (quota=0)\nSuspending websites...\nUsing Universal Quota Support (quota=5120)\nSuspending FTP accounts...\nUpdating FTP passwords for noftp\nFTP password files updated.\nFTP vhost passwords synced\nnoftp's account has been suspended\n",
   "result":[  
      {  
         "statusmsg":"Finished suspending reseller.",
         "status":1
      }
   ]
}
 Output (XML)
<suspendreseller>
    <output>
        Changing Shell to /bin/false...Changing shell for username. Warning: "/bin/false" is not listed in /etc/shells. Shell not changed. Done Locking Password...Locking password for user username. passwd: Success Done 1Suspending email account logins for username.tld .... Done Suspending mysql users Account previously suspended (password was locked). Using Universal Quota Support (quota=0) Suspending websites... Using Universal Quota Support (quota=512000) Updating FTP passwords for username FTP password files updated. FTP vhost passwords synced username's account has been suspended Changing Shell to /bin/false...Changing shell for noftp. Warning: "/bin/false" is not listed in /etc/shells. Shell not changed. Done Locking Password...Locking password for user noftp. passwd: Success Done 1Suspending mysql users Account previously suspended (password was locked). Using Universal Quota Support (quota=0) Suspending websites... Using Universal Quota Support (quota=5120) Updating FTP passwords for noftp FTP password files updated. FTP vhost passwords synced noftp's account has been suspended
    </output>
    <result>
        <status>1</status>
        <statusmsg>Finished suspending reseller.</statusmsg>
    </result>
</suspendreseller>



Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The reseller's username.

A valid reseller username on the server.username
reasonstring

The reason for the reseller's suspension.

Note:

We strongly recommend that you always include a reason for suspension. 

A valid string.

Nonpayment

Returns

ReturnTypeDescriptionPossible valuesExample
outputstringOutput from the function's action.

One or more valid strings.

Note:

This output may contain HTML. 

 Click to view...
Changing Shell to /bin/false...Changing shell for username. Warning: "/bin/false" is not listed in /etc/shells. Shell not changed. Done Locking Password...Locking password for user username. passwd: Success Done 1Suspending email account logins for username.tld .... Done Suspending mysql users Account previously suspended (password was locked). Using Universal Quota Support (quota=0) Suspending websites... Using Universal Quota Support (quota=512000) Updating FTP passwords for username FTP password files updated. FTP vhost passwords synced username's account has been suspended Changing Shell to /bin/false...Changing shell for noftp. Warning: "/bin/false" is not listed in /etc/shells. Shell not changed. Done Locking Password...Locking password for user noftp. passwd: Success Done 1Suspending mysql users Account previously suspended (password was locked). Using Universal Quota Support (quota=0) Suspending websites... Using Universal Quota Support (quota=5120) Updating FTP passwords for noftp FTP password files updated. FTP vhost passwords synced noftp's account has been suspended

result

array of hashes

An array of hashes of function output.

This hash includes the status and statusmsg returns.

 

status

Boolean

Whether the function succeeded.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

A message of success or a reason for failure.

The function returns this value in the  result hash.

  • Finished suspending reseller.
  • An error message.
Finished suspending reseller.