You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

Child pages
  • WHM API 1 Functions - editpkg
Skip to end of metadata
Go to start of metadata

Description

This function edits a hosting plan (package).

Note:

  • This function will apply any changes you make to all accounts that exist on the hosting plan.
  • This function cannot modify hosting plan names.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/editpkg?api.version=1&name=package1&featurelist=default&quota=10240&ip=n&cgi=1&frontpage=0&cpmod=paper_lantern&language=en&max_emailacct_quota=1024&maxftp=unlimited&maxsql=unlimited&maxpop=unlimited&maxlists=unlimited&maxsub=unlimited&maxpark=unlimited&maxaddon=unlimited&hasshell=1&bwlimit=1048576&max_email_per_hour=unlimited&max_defer_fail_percentage=unlimited&digestauth=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/editpkg?api.version=1&name=package1&featurelist=default&quota=10240&ip=n&cgi=1&frontpage=0&cpmod=paper_lantern&language=en&max_emailacct_quota=1024&maxftp=unlimited&maxsql=unlimited&maxpop=unlimited&maxlists=unlimited&maxsub=unlimited&maxpark=unlimited&maxaddon=unlimited&hasshell=1&bwlimit=1048576&max_email_per_hour=unlimited&max_defer_fail_percentage=unlimited&digestauth=1
 Command Line
whmapi1 editpkg name=package1 featurelist=default quota=10240 ip=n cgi=1 frontpage=0 cpmod=paper_lantern language=en max_emailacct_quota=1024 maxftp=unlimited maxsql=unlimited maxpop=unlimited maxlists=unlimited maxsub=unlimited maxpark=unlimited maxaddon=unlimited hasshell=1 bwlimit=1048576 max_email_per_hour=unlimited max_defer_fail_percentage=unlimited digestauth=1


Notes:

  • Unless otherwise noted, 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)
{
   "data" : {
      "pkg" : "package1"
   },
   "metadata" : {
      "version" : 1,
      "result" : 1,
      "command" : "editpkg",
      "reason" : "OK"
   }
}
 Output (XML)
 <data>
   <pkg>package1</pkg>
 </data>
 <metadata>
   <command>editpkg</command>
   <reason>OK</reason>
   <result>1</result>
   <version>1</version>
 </metadata>


Note:

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

Parameters

Note:

The Access Control List (ACL) restricts some of the following parameters, which limit the features that WHM users can access. For more information, read our Access Control Lists documentation.

ParameterTypeDescriptionPossible valuesExample
namestring

Required

The hosting plan's name.

If the hosting plan does not exist, the system will create it.

A hosting plan name.

package1
featureliststring

The hosting plan's feature list.

If you do not use this parameter, the function assigns the default feature list to the hosting plan's accounts.

A valid feature list name on the server.default
quotastring

The hosting plan's disk space quota.

Note:

In cPanel & WHM version 70 and earlier, this parameter defaults to unlimited.

This parameter defaults to 10240.

  • A positive integer between one and 999,999 that represents the maximum disk space that the account may use, in megabytes (MB).
  • 0, unlimited, or null — The hosting plan's disk space is unlimited.

    Note:

    The 0, unlimited, or null values are only available to users that possess the corresponding unlimited ACL permission.

10240
ipstring

Whether the account has a dedicated IP address.

This parameter defaults to n.

  • y — The account possesses a dedicated IP address.
  • n — The account does not possess a dedicated IP address.
n
cgiBoolean

Whether CGI access is enabled for the account.

Note:

In cPanel & WHM version 86 and later, when a server profile disables the Web Server role, this parameter defaults to 0. On these servers, you cannot enable CGI access.

This parameter defaults to 1 .

  • 1 — Enabled.
  • 0 — Disabled.
1
frontpageBoolean

Whether Microsoft® FrontPage Extensions are enabled for the account.

Note:

cPanel & WHM will ignore all FrontPage settings and parameters if either of the following statements is true:

  • The server runs cPanel & WHM version 11.44 and FrontPage Extensions are not installed.
  • The server runs cPanel & WHM version 11.46 or later.

This parameter defaults to 0.

  • 1 — Enabled.
  • 0 — Disabled.
0
cpmodstring

The hosting plan's cPanel theme.

This parameter defaults to the server's default cPanel theme.

  • paper_lantern
  • A valid theme on the server.
paper_lantern
languagestring

The hosting plan's default locale.

This parameter defaults to the server's default locale.

A two-letter ISO-3166 code. en
max_emailacct_quotastring

The hosting plan's maximum email account quota size.

Note:

  • This parameter does not affect any existing email accounts.
  • We introduced this parameter in cPanel & WHM version 70.

This parameter defaults to 1024.

  • A positive integer between one and 4,294,967,296 that represents the maximum email quota size, in MB.
  • unlimited — The account possesses an unlimited quota.

    Note:

    The 0, unlimited, or null values are only available to users that possess the corresponding unlimited ACL permission.

1024
maxftp string

The hosting plan's maximum number of FTP accounts.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited FTP accounts.
unlimited
maxsql string

The hosting plan's maximum number of each available type of SQL database.

For example, if you set this value to 5 and the system administrator allows MySQL® and PostgreSQL® databases, users can create up to five MySQL databases and up to five PostgreSQL databases.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited databases.
unlimited
maxpop string

The hosting plan's maximum number of email accounts.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited email accounts.
unlimited
maxlists string

The hosting plan's maximum number of mailing lists.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited mailing lists.
unlimited
maxsub string

The hosting plan's maximum number of subdomains.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited subdomains.
unlimited
maxpark string

The hosting plan's maximum number of parked domains (aliases).

This parameter defaults to 0.

  • An integer between zero and 999,999.
  • unlimited or null — The account possesses unlimited parked domains.
unlimited
maxaddon string

The hosting plan's maximum number of addon domains.

This parameter defaults to 0.

  • An integer between zero and 999,999.
  • unlimited or null — The account possess unlimited addon domains.
unlimited
hasshellBoolean

Whether the account has shell access.

This parameter defaults to 0.

  • 1 — The account has shell access.
  • 0 — No shell access.
1
bwlimit string

The hosting plan's maximum bandwidth use.

Note:

In cPanel & WHM version 70 and earlier, this parameter defaults to unlimited.

This parameter defaults to 1048576.

  • A positive integer between one and 999,999 that represents the maximum bandwidth use, in megabytes (MB).
  • 0, unlimited, or null — The account possesses unlimited bandwidth.

    Note:

    The 0, unlimited, or null values are only available to users that possess the corresponding unlimited ACL permission.

1048576
max_email_per_hour string

The maximum number of emails that the account can send in one hour.

Note:

This parameter is only available in cPanel & WHM version 11.32 or later. 

This parameter defaults to unlimited.

  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of emails.

unlimited
max_defer_fail_percentage string

The percentage of failed or deferred email messages that the account can send per hour before outgoing mail is rate-limited.

Note:

This parameter is only available in cPanel & WHM version 11.32 or later. 

This parameter defaults to unlimited.

  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of failed or deferred messages.
unlimited
digestauthBoolean

Whether to enable Digest Authentication for accounts on the hosting plan.

Note:

This parameter is only available in cPanel & WHM version 11.34 or later.

This parameter defaults to 0.

  • 1 — Enable.
  • 0 — Disable.
1
_PACKAGE_EXTENSIONSstring

The hosting plan's package extensions.

If you do not provide a value, the hosting plan will not include package extensions.

Note:

  • This parameter is only available in cPanel & WHM version 11.40 and later.
  • In cPanel & WHM 68 and later, we strongly recommend that you manage package extensions through WHM API 1's addpkgext and delpkgext functions.

A space-delimited list of one or more package extensions on the server.

Note:

  • You can also include the extension's variables in your function call, in key=value format. Consult the extension's documentation for a list of possible variables.
  • Extension names and variables are case-sensitive.
extension1 extension2 extension3

Returns

ReturnTypeDescriptionPossible valuesExample
changepackagearray of hashes

An array of hashes that contains the update status of accounts that exist on the hosting plan.

Note:

  • If no accounts use the package, this function returns an empty array.
  • We removed this array of hashes in cPanel & WHM version 88.
This array includes the outputstatusstatusmsg, and user returns.

output

string

An output of all the account modifications.

The function returns this value in the changepackage array of hashes.

A string in HTML format.
 Click to view...

<pre>\nChanging the account bandwidth limit from “unlimited” to “unlimited”.\nChanging Feature List to default\nChanging the maximum email accounts from “unlimited” to “unlimited”.\nChanging the maximum SQL databases from “unlimited” to “unlimited”.\nChanging the maximum FTP accounts from “unlimited” to “unlimited”.\nChanging the maximum mailing lists from “unlimited” to “unlimited”.\nChanging the maximum subdomains from “unlimited” to “unlimited”.\nChanging the maximum email quota 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 (noshell)\nChanging cPanel theme from paper_lantern to paper_lantern\nChanging plan from package1 to package1\nBandwidth limit (unlimited) is lower than (unlimited) (all limits removed)<br /><blockquote><div style='float:left;'>Enabling...</div><div style='float:left;'>...example2.com...</div><div style='float:left;'>Done</div></blockquote><br /><div class='clearit' style='clear:both; width:80%;'> </div>Setting quota to “unlimited”.\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</pre>

status

Boolean

Whether the system modified the account.

The function returns this value in the changepackage array of hashes.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

A message about the status of the account update.

The function returns this value in the changepackage array of hashes.

A valid string.Account Upgrade/Downgrade Complete for username

user

string

The modified account.

The function returns this value in the changepackage array of hashes.

A valid username.username

pkg

string

The hosting plan's name.

The name input parameter's value.package1