WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function creates a hosting plan (package).
Note:
The Access Control Lists restricts some of this function's parameters, which limit the features that WHM users can access.
The new hosting plan's name.
Note:
- You cannot use the name
extensionsfor a hosting plan. - You cannot modify hosting plan names after creation. Do not include details that may change over time, such as price.
A space-separated list of the hosting plan's package extensions.
If you do not provide a value, the hosting plan will not include package extensions.
Note:
- We strongly recommend that you manage package extensions through WHM API 1's
addpkgextanddelpkgextfunctions. - You can include the extension's variables in your function call, in
key=valueformat. Consult the extension's documentation for a list of possible variables. - Extension names and variables are case-sensitive.
The hosting plan's maximum bandwidth use, in megabytes (MB).
0,unlimited, ornull— The hosting plan allows unlimited bandwidth.
Note:
The 0, unlimited, and null values are only available to users that possess the corresponding unlimited ACL permission.
Whether CGI access is enabled for the account.
1— Enabled.0— Disabled.
Note:
When a server profile disables the Web Server role, this parameter defaults to 0. On these servers, you cannot enable CGI access.
The hosting plan's cPanel theme.
This parameter defaults to the server's default cPanel theme.
Whether to enable Digest Authentication for accounts on the hosting plan.
1— Enable.0— Disable.
The hosting plan's feature list.
If you do not use this parameter, the function assigns the default feature list to the account.
Whether the hosting plan allows shell access.
1— The hosting plan allows shell access.0— The hosting plan does not allows shell access.
Whether the account has a dedicated IP address.
y— The account possesses a dedicated IP address.n— The account does not possess a dedicated IP address.
The hosting plan's default locale, in its two-letter ISO-3166 code format.
This parameter defaults to the server's default locale.
The percentage of failed or deferred email messages that the hosting plan allows users to send per hour before outgoing mail is rate-limited.
0orunlimited— The hosting plan allows users ot send an unlimited number of failed or deferred messages.
The maximum number of emails that the hosting plan allows users to send in one hour.
0orunlimited— The hosting plan allows users to send an unlimited number of emails.
The hosting plan's maximum email account quota size, in megabytes (MB).
0,unlimited, ornull— The hosting plan allows unlimited email account quota.
Note:
The 0, unlimited, and null values are only available to users that possess the corresponding unlimited ACL permission.
The hosting plan's maximum number of Team users.
The hosting plan's maximum number of addon domains.
unlimitedornull— The hosting plan allows unlimited addon domains.
The hosting plan's maximum number of FTP accounts.
unlimited, ornull— The hosting plan allows unlimited FTP accounts.
The hosting plan's maximum number of mailing lists.
unlimited, ornull— The hosting plan allows unlimited mailing lists.
The hosting plan's maximum number of parked domains (aliases).
unlimitedornull— The hosting plan allows unlimited parked domains.
The hosting plan's maximum number of email accounts.
unlimited, ornull— The hosting plan allows unlimited email accounts.
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.
unlimited, ornull— The hosting allows unlimited databases.
The hosting plan's maximum number of subdomains.
unlimited, ornull— The hosting plan allows unlimited subdomains.
The hosting plan's disk space quota, in megabytes (MB).
0,unlimited, ornull— The hosting plan allows unlimited disk space.
Note:
The 0, unlimited, and null values are only available to users that possess the corresponding unlimited ACL permission.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/addpkg
- A server running WHM.
https://whm-server.tld:2087/json-api/addpkg
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/addpkg?name=package1&_PACKAGE_EXTENSIONS=%27extension1+extension2+extension3%27&bwlimit=1048576&cgi=1&cpmod=jupiter&digestauth=1&featurelist=feature_list&hasshell=1&ip=n&language=en&MAX_DEFER_FAIL_PERCENTAGE=unlimited&MAX_EMAIL_PER_HOUR=unlimited&max_emailacct_quota=1024&max_team_users=7&maxaddon=unlimited&maxftp=unlimited&maxlst=unlimited&maxpark=unlimited&maxpop=unlimited&maxsql=unlimited&maxsub=unlimited"a=10240&frontpage=0'{ "data": { "pkg": "package1" }, "metadata": { "command": "addpkg", "reason": "OK", "result": 1, "version": 1 } }
Request
This function edits a hosting plan (package).
Note:
- The Access Control List (ACL) restricts some of the function's parameters, which limit the features that WHM users can access.
- This function applies any changes you make to all accounts that exist on the hosting plan.
- This function cannot modify hosting plan names.
The hosting plan's name. If the hosting plan does not exist, the system will create it.
The hosting plan's package extensions.
If you do not provide a value, the hosting plan will not include package extensions.
Note:
- We strongly recommend that you manage package extensions through WHM API 1's
addpkgextanddelpkgextfunctions. - You can include the extension's variables in your function call, in
key=valueformat. Consult the extension's documentation for a list of possible variables. - Extension names and variables are case-sensitive.
- Use space-delimited format to add multiple package extensions.
The hosting plan's maximum bandwidth use, in megabytes (MB).
0,unlimited, ornull— The hosting plan allows unlimited bandwidth.
Note:
The 0, unlimited, or null values are only available to users that possess the corresponding unlimited ACL permission.
Whether CGI access is enabled for the hosting plan.
1— Enabled.0— Disabled.
Note:
When a server profile disables the Web Server role, this parameter defaults to 0. On these servers, you cannot enable CGI access.
The hosting plan's cPanel theme.
This parameter defaults to the server's default cPanel theme.
Whether to enable Digest Authentication for accounts on the hosting plan.
1— Enable.0— Disable.
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.
Whether the hosting plan allows shell access.
1— The hosting plan allows shell access.0— The hosting plan does not allow shell access.
Whether the hosting plan uses a dedicated IP address.
y— The hosting plan uses a dedicated IP address.n— The hosting plan does not use a dedicated IP address.
The hosting plan's default locale.
This parameter defaults to the server's default locale.
The percentage of failed or deferred email messages that an account on the hosting plan can send per hour before outgoing mail is rate-limited.
0orunlimited— The hosting plan allows unlimited email messages per hour.
The maximum number of emails that the hosting plan allows accounts to send in one hour.
0orunlimited— The hosting plan allows unlimited emails per hour.
The hosting plan's maximum email account quota size, in megabytes (MB).
0,null, orunlimited` — The hosting plan allows unlimited quota.
Note:
- This parameter does not affect any existing email accounts.
- The
unlimitedvalue is only available to users that possess the correspondingunlimitedACL permission.
The hosting plan's maximum number of Team users.
The hosting plan's maximum number of addon domains.
unlimitedornull— The hosting plan allows unlimited addon domains.
The hosting plan's maximum number of FTP accounts.
unlimited, ornull— The hosting plan allows unlimited databases.
The hosting plan's maximum number of mailing lists.
unlimited, ornull— The hosting plan allows unlimited mailing lists.
The hosting plan's maximum number of parked domains (aliases).
unlimitedornull— The hosting plan allows unlimited parked domains.
The hosting plan's maximum number of email accounts.
unlimited, ornull— The hosting plan allows unlimited email accounts.
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 with this hosting plan can create up to five MySQL databases and up to five PostgreSQL databases.
unlimited, ornull— The hosting plan allows unlimited databases.
The hosting plan's maximum number of subdomains.
unlimited, ornull— The hosting plan allows unlimited subdomains.
The hosting plan's disk space quota, in megabytes (MB).
0,unlimited, ornull— The hosting plan allows unlimited disk space quota.
Note:
The 0, unlimited, or null values are only available to users that possess the corresponding unlimited ACL permission.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/editpkg
- A server running WHM.
https://whm-server.tld:2087/json-api/editpkg
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/editpkg?name=package1&_PACKAGE_EXTENSIONS=string&bwlimit=1048576&cgi=1&cpmod=jupiter&digestauth=1&featurelist=default&hasshell=1&ip=n&language=en&max_defer_fail_percentage=unlimited&max_email_per_hour=unlimited&max_emailacct_quota=1024&max_team_users=7&maxaddon=unlimited&maxftp=unlimited&maxlst=unlimited&maxpark=unlimited&maxpop=unlimited&maxsql=unlimited&maxsub=unlimited"a=10240&frontpage=0'{ "data": { "pkg": "package1" }, "metadata": { "command": "editpkg", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/getpkginfo
- A server running WHM.
https://whm-server.tld:2087/json-api/getpkginfo
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/getpkginfo?pkg=package1'{ "data": { "pkg": { … } }, "metadata": { "command": "getpkginfo", "reason": "OK", "result": 1, "version": 1 } }