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

Description

This function lists the authenticated user's available hosting plans (packages).

Important:

This function only returns packages that a user with root-level privileges or a reseller can use when they create an account.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/listpkgs?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/listpkgs?api.version=1
 Command Line
whmapi1 listpkgs


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)
{  
   "data":{
   "pkg":[
      {
         "FRONTPAGE":"n",
         "CPMOD":"paper_lantern",
         "FEATURELIST":"default",
         "BWLIMIT":"unlimited",
         "IP":"n",
         "CGI":"y",
         "MAXSUB":"unlimited",
         "name":"standard",
         "MAXSQL":"unlimited",
         "MAXFTP":"unlimited",
         "QUOTA":"unlimited",
         "MAXPARK":"2",
         "HASSHELL":"y",
         "MAXADDON":"2",
         "MAXPOP":"unlimited",
         "MAXLST":"unlimited",
         "MAX_EMAILACCT_QUOTA": "unlimited",
         "LANG":"english"
      },
      {
         "FRONTPAGE":"n",
         "CPMOD":"paper_lantern",
         "FEATURELIST":"Default",
         "BWLIMIT":"9999",
         "IP":"y",
         "CGI":"y",
         "MAXSUB":"888",
         "name":"bronze",
         "MAXSQL":"99",
         "MAXFTP":"9",
         "QUOTA":"unlimited",
         "MAXPARK":"88",
         "HASSHELL":"y",
         "MAXADDON":"888",
         "MAXPOP":"999",
         "MAXLST":"999",
         "MAX_EMAILACCT_QUOTA": "unlimited",
         "LANG":"english"
      },
      {
         "FRONTPAGE":"n",
         "CPMOD":"paper_lantern",
         "FEATURELIST":"default",
         "BWLIMIT":"unlimited",
         "IP":"n",
         "CGI":"y",
         "MAXSUB":"unlimited",
         "name":"silver",
         "MAXSQL":"unlimited",
         "MAXFTP":"unlimited",
         "QUOTA":"unlimited",
         "MAXPARK":"0",
         "HASSHELL":"y",
         "MAXADDON":"0",
         "MAXPOP":"unlimited",
         "MAXLST":"unlimited",
         "MAX_EMAILACCT_QUOTA": "unlimited",
         "LANG":"english"
      },
      {
         "FRONTPAGE":"n",
         "CPMOD":"paper_lantern",
         "FEATURELIST":"default",
         "BWLIMIT":"unlimited",
         "MAXSUB":"unlimited",
         "CGI":"y",
         "IP":"n",
         "name":"gold",
         "MAXSQL":"unlimited",
         "MAXPARK":"2",
         "QUOTA":"unlimited",
         "MAXFTP":"unlimited",
         "HASSHELL":"y",
         "MAXADDON":"2",
         "LANG":"english",
         "MAXLST":"unlimited",
         "MAXPOP":"unlimited",
         "MAX_EMAILACCT_QUOTA": "unlimited"
      }
   ]
},
  "metadata": {
    "command": "listpkgs",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}
 Output (XML)
	<data>
      <pkg>
            <name>gold</name>
            <BWLIMIT>unlimited</BWLIMIT>
            <CGI>y</CGI>
            <CPMOD>paper_lantern</CPMOD>
            <FEATURELIST>default</FEATURELIST>
            <FRONTPAGE>n</FRONTPAGE>
            <HASSHELL>y</HASSHELL>
            <IP>n</IP>
            <LANG>english</LANG>
            <MAXADDON>2</MAXADDON>
			<MAX_EMAILACCT_QUOTA>unlimited</MAX_EMAILACCT_QUOTA>
            <MAXFTP>unlimited</MAXFTP>
            <MAXLST>unlimited</MAXLST>
            <MAXPARK>2</MAXPARK>
            <MAXPOP>unlimited</MAXPOP>
            <MAXSQL>unlimited</MAXSQL>
            <MAXSUB>unlimited</MAXSUB>
            <QUOTA>unlimited</QUOTA>
      </pkg>
	</data>
	<metadata>
		<command>listpkgs</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

ParameterTypeDescriptionPossible valuesExample
wantstring

The permissions of packages that you wish to list.

This parameter defaults to all.

  • all — All packages on the system.
  • creatable — Packages that the authenticated user can use for accounts.
  • editable — Packages that the authenticated user can edit.
  • viewable — Packages that the authenticated user can view.
all

Returns

ReturnTypeDescriptionPossible valuesExample
pkghashA hash of hosting plan settings.

This function contains one or more of the following returns: nameMAXSUBMAXADDON, MAX_DEFER_FAIL_PERCENTAGE, _PACKAGE_EXTENSIONSCPMOD, MAX_EMAIL_PER_HOUR, MAX_EMAILACCT_QUOTALANG, MAXLSTMAXPARKMAXSQL, FEATURELISTCGIMAXFTP, BWLIMITQUOTADIGESTAUTH, IP.

Note:

If the account or its hosting plan use package extensions, the pkg hash also includes the extension's variables.

 

name

string

The hosting plan name.

The function returns this value in the pkg hash.

A valid hosting plan name.package1

MAXSUB

string

The hosting plan's maximum number of subdomains.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of subdomains.
unlimited

MAXADDON

string

The hosting plan's maximum number of addon domains.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of addon domains.
unlimited

MAX_DEFER_FAIL_PERCENTAGE

string

The percentage of failed or deferred email messages that the hosting plan can send per hour before the system rate-limits outgoing mail.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a percentage of messages.
unlimited

_PACKAGE_EXTENSIONS

string

The hosting plan's package extensions.

The function returns this value in the pkg hash.

A space-separated list of one or more package extension names.ext1 ext2 ext3

CPMOD

string

The hosting plan's cPanel interface theme.

The function returns this value in the pkg hash.

  • paper_lantern
  • Another valid theme on the server.
paper_lantern

MAX_EMAIL_PER_HOUR

string

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

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of sent emails.
unlimited

MAX_EMAILACCT_QUOTA

string

The hosting plan's maximum email account quota size, in Megabytes (MB).

Note:

We introduced this return in cPanel & WHM version 70.

This function returns this value in the pkg hash.

  • unlimited
  • A positive integer that represents the maximum email quota, in Megabytes (MB).
unlimited

LANG

string

The hosting plan's locale.

The function returns this value in the pkg hash.

The ISO code for any locale on the server.en

MAXLST

string

The hosting plan's maximum number of mailing lists.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of mailing lists.
unlimited

MAXPARK

string

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

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of parked domains.
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.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of SQL databases.
unlimited

FEATURELIST

string

The hosting plan's featurelist.

The function returns this value in the pkg hash.

A valid feature list name.default

CGI

Boolean

Whether CGI is enabled for the hosting plan.

The function returns this value in the pkg hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

MAXFTP

string

The hosting plan's maximum number of FTP accounts.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of FTP accounts.
unlimited

BWLIMIT

string

The hosting plan's bandwidth limit.

The function returns this value in the pkg hash.

  • unlimited
  • A maximum amount of bandwidth, in Megabytes (MB).
unlimited

QUOTA

string

The hosting plan's disk space limit.

The function returns this value in the pkg hash.

  • unlimited
  • A maximum amount of disk space, in Megabytes (MB).
unlimited

DIGESTAUTH

string

Whether the hosting plan enables Digest Authentication.

The function returns this value in the pkg hash.

  • y — Enable.
  • n — Disable.
n

IP

string

Whether the hosting plan grants accounts a dedicated IP address.

The function returns this value in the pkg hash.

  • y — Dedicated IP address.
  • n — Shared IP address.
n