Child pages
  • WHM API 1 Functions - changepackage
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?api.version=1&user=username&pkg=package1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/changepackage?api.version=1&user=username&pkg=package1
 Command Line
whmapi1 changepackage user=username pkg=package1


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{  
   "metadata":{  
      "output":{  
         "raw":"<pre>\nChanging the account bandwidth limit from "unlimited" to "524288000".\nChanging Feature List to default\nChanging the maximum email accounts from "7" to "5".\nChanging the maximum SQL databases from "unlimited" to "5".\nChanging the maximum FTP accounts from "unlimited" to "5".\nChanging the maximum mailing lists from "unlimited" to "5".\nChanging the maximum subdomains from "5" to "unlimited".\nChanging the maximum email quota from "500" 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 "5" to "unlimited".\nChanging the maximum addon domains from "3" to "unlimited".\nShell Access Set Correctly\nChanging cPanel theme from paper_lantern to paper_lantern\nChanging plan from extensions_username_username_username 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"
      },
      "result":1,
      "command":"changepackage",
      "reason":"Account Upgrade/Downgrade Complete for username",
      "version":1
   }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>Account Upgrade/Downgrade Complete for username</reason>
        <output>
            <raw>
                 <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 the maximum email quota from "500" 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>
            </raw>
        </output>
        <result>1</result>
        <command>changepackage</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

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

This function only returns metadata.