Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function changes a cPanel account's hosting plan (package).

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/changepackage?user=username&pkg=package1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/changepackage?user=username&pkg=package1
 Command Line
whmapi0 changepackage user=username pkg=package1

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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "result":[
      {
         "status":1,
         "statusmsg":"Account Upgrade/Downgrade Complete for username",
         "rawout":"<pre>\nChanging the account bandwidth limit from "524288000" to "524288000".\nChanging Feature List to default\nChanging the maximum email accounts from "5" to "5".\nChanging the maximum SQL databases from "5" to "5".\nChanging the maximum FTP accounts from "5" to "5".\nChanging the maximum mailing lists from "5" to "5".\nChanging the maximum subdomains from "unlimited" to "unlimited".\nChanging \"Maximum Hourly Email by Domain Relayed\" from unlimited to unlimited\nChanging \"Maximum percentage of failed or deferred messages a domain may send per hour\" from unlimited to unlimited\nChanging the maximum parked domains from "unlimited" to "unlimited".\nChanging the maximum addon domains from "unlimited" to "unlimited".\nShell Access Set Correctly\nChanging cPanel theme from paper_lantern to paper_lantern\nChanging plan from package to package\nBandwidth limit (524288000) is lower than (unlimited) (all limits removed)<br /><blockquote><div style='float:left;'>Enabling...</div><div style='float:left;'>...addondomain.com...</div><div style='float:left;'>...example.com...</div><div style='float:left;'>Done</div></blockquote><br /><div class='clearit' style='clear:both; width:80%;'>&nbsp;</div>Setting quota to "500".\n<span class=\"b2\">Warning, this will not change shared IP accounts to dedicated IP accounts, or the reverse.</span>\n<span class=\"b2\">Warning: Changing a user's package does not affect their Digest Authentication settings.</span>\n" 
      }
   ]
}
 Output (XML)
<changepackage>
    <result>
        <rawout>
            <pre> Changing the account bandwidth limit from "524288000" to "524288000". Changing Feature List to default Changing the maximum email accounts from "5" to "5". Changing the maximum SQL databases from "5" to "5". Changing the maximum FTP accounts from "5" to "5". Changing the maximum mailing lists from "5" to "5". Changing the maximum subdomains from "unlimited" to "unlimited". Changing "Maximum Hourly Email by Domain Relayed" from unlimited to unlimited Changing "Maximum percentage of failed or deferred messages a domain may send per hour" from unlimited to unlimited Changing the maximum parked domains from "unlimited" to "unlimited". Changing the maximum addon domains from "unlimited" to "unlimited". Shell Access Set Correctly Changing cPanel theme from paper_lantern to paper_lantern Changing plan from package to package Bandwidth limit (524288000) is lower than (unlimited) (all limits removed)<br /><blockquote><div style='float:left;'>Enabling...</div><div style='float:left;'>...addondomain.com...</div><div style='float:left;'>...example.com...</div><div style='float:left;'>Done</div></blockquote><br /><div class='clearit' style='clear:both; width:80%;'>&nbsp;</div>Setting quota to "500". <span class="b2">Warning, this will not change shared IP accounts to dedicated IP accounts, or the reverse.</span> <span class="b2">Warning: Changing a user's package does not affect their Digest Authentication settings.</span>
        </rawout>
        <status>1</status>
        <statusmsg>Account Upgrade/Downgrade Complete for username</statusmsg>
    </result>
</changepackage>

   

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The cPanel account's username.

A valid cPanel account on the server.username
pkgstring

Required

The hosting plan's name.

An existing hosting plan name on the server.

package1

Returns

ReturnTypeDescriptionPossible valuesExample
resulthashAn array of hashes of function information.This hash includes the status, statusmsg, and pkg 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.

  • Account Upgrade/Downgrade Complete for username
  • An error message.
Account Upgrade/Downgrade Complete for username

rawout

string

The function's raw output.

The function returns this value in the result hash.

One or more string messages that describe the function's action.

Note:

This value may contain HTML. 

 Click to view...
<pre> Changing the account bandwidth limit from “524288000” to “524288000”. Changing Feature List to default Changing the maximum email accounts from “5” to “5”. Changing the maximum SQL databases from “5” to “5”. Changing the maximum FTP accounts from “5” to “5”. Changing the maximum mailing lists from “5” to “5”. Changing the maximum subdomains from “unlimited” to “unlimited”. Changing "Maximum Hourly Email by Domain Relayed" from unlimited to unlimited Changing "Maximum percentage of failed or deferred messages a domain may send per hour" from unlimited to unlimited Changing the maximum parked domains from “unlimited” to “unlimited”. Changing the maximum addon domains from “unlimited” to “unlimited”. Shell Access Set Correctly Changing cPanel theme from paper_lantern to paper_lantern Changing plan from package to package Bandwidth limit (524288000) is lower than (unlimited) (all limits removed)<br /><blockquote><div style='float:left;'>Enabling...</div><div style='float:left;'>...addondomain.com...</div><div style='float:left;'>...example.com...</div><div style='float:left;'>Done</div></blockquote><br /><div class='clearit' style='clear:both; width:80%;'>&nbsp;</div>Setting quota to “500”. <span class="b2">Warning, this will not change shared IP accounts to dedicated IP accounts, or the reverse.</span> <span class="b2">Warning: Changing a user’s package does not affect their Digest Authentication settings.</span>