Description
This function lists the cPanel account's subaccounts.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
flat |
Boolean |
Whether to return subaccounts with the same name under themerge_candidates array. This parameter defaults to 0. |
|
0 |
Returns
Return |
Type |
Description |
Possible values |
Example |
alternate_email |
string |
An alternate email address for the subaccount's user. |
A valid email address. |
user@example.com |
avatar_url |
string |
The URL to the user's subaccount profile photo. Note: Use the HTTPS protocol to prevent mixed content warnings when users view it from another HTTPS URL. |
A valid HTTPS URL that points to an image file. |
|
can_delete |
boolean |
Whether the cPanel account user can delete the subaccount. |
|
0 |
can_set_password |
boolean |
Whether the cPanel account user can change the subaccount's password.
|
Note: The function returns a 0 value for subaccounts who inherit their password from the cPanel account. |
1 |
can_set_quota |
boolean |
Whether the cPanel account user can change the subaccount's disk usage quota. |
|
0 |
dismissed |
boolean |
Whether the cPanel account user dismissed the merge prompt for the service account. Note: Only service accounts return this value. |
|
1 |
domain |
string |
The subaccount user's associated domain. |
A domain that the cPanel account owns. |
example.com |
full_username |
string |
The subaccount's username and domain name. |
A valid username, the @ character, and the associated domain. |
user@example.com |
guid |
string |
The subaccountunique identifier. Note: The subaccount's globally unique identifier (GUID) does not change when you adjust its other attributes. |
The system assigned unique value. |
|
issues |
array |
This array of hashes contains information about any issues or problems with the subaccount. |
This array contains the type, area, service,message, used, and limit values. |
|
type |
string |
The type of issue. The function returns this value in theissues array. |
|
info |
area |
string |
The affected section of cPanel & WHM. |
quota |
quota |
service |
string |
The affected service. The function returns this value in theissues array. |
|
|
message |
string |
The description of the issue. The function returns this value in theissues array. |
A message that contains a description of the issue. |
Your account is over quota. |
used |
string |
The number of Megabytes (MB) that the account currently uses. The function returns this value in theissues array. |
A positive integer. |
2000 |
limit |
string |
The set quota Megabyte (MB) limit for the affected subaccount. The function returns this value in theissues array. |
A positive integer. |
1500 |
merge_candidates |
array |
An array of hashes that represents the service accounts that the system could merge for this subaccount. |
This array contains the alternate_email,avatar_url, can_delete, can_set_password,can_set_quota, dismissed, domain,full_username, guid, has_siblings, issues,merge_candidates, parent_type, phone_number,real_name, services, special,sub_account_exists, synced_password, type, andusername values. |
|
has_siblings |
boolean |
Whether the service account shares afull_username value with another service account. |
|
0 |
parent_type |
string |
The type of account that could own the service account. |
|
hypothetical |
phone_number |
string |
The subaccount user's phone number. |
A valid phone number that conforms to ITU-T'sE.164 recommended standard for the representation of telephone numbers. |
+15551234567 |
real_name |
string |
The name of the subaccount's user. |
|
John Doe |
services |
hash |
This hash contains information about the subaccount's access to email, FTP, and Web Disk. |
This hash contains the email, ftp, and webdiskvalues. |
|
|
hash |
This hash contains the information that indicates the subaccount's email status. |
This hash contains the enabled and quota values. |
|
enabled |
boolean |
Whether the subaccount can access Webmail, POP, and IMAP services. |
|
1 |
quota |
string |
The subaccount's email disk space quota. |
|
100 |
ftp |
hash |
This hash contains the information that indicates the subaccount's FTP status. |
This hash contains the enabled, quota, and homedirvalues. |
|
enabled |
boolean |
Whether the subaccount can access FTP. |
|
0 |
quota |
string |
The subaccount's FTP disk space quota. |
|
100 |
homedir |
string |
The subaccount's FTP home directory. |
A relative path from the cPanel account's home directory on the server. |
/subaccount |
webdisk |
hash |
This hash contains the information that indicates the subaccount's Web Disk status. |
This hash contains the enabled, homedir, perms, and private values. |
|
enabled |
boolean |
Whether the subaccount can access Web Disk. |
|
0 |
homedir |
string |
The path to the subaccount's directory, relative to the cPanel account's home directory. |
A valid path. |
/bob |
perms |
string |
Whether to grant write permissions to the subaccount. |
|
rw |
private |
boolean |
Whether to set the Web Disk directory's permissions to public or private. Notes:
|
0 |
|
special |
boolean |
Whether the account is a system-created special account that the user cannot remove.
|
|
1 |
sub_account_exists |
boolean |
Whether a subaccount exists with the same username. |
Note: The function returns this attribute as nullvalue if the account type is not a service account. |
0 |
synced_password |
boolean |
Whether the user has synchronized the passwords for each of the subaccount'sservice accounts. |
Note: The function returns this attribute as nullvalue if the account type is not a subaccount. |
0 |
type |
string |
The type of account. |
|
sub |
username |
string |
The username for the subaccount. Notes: This value does not include the domain name. |
A username that meets the subaccount name limitations.
|
example |