Description
This function deletes a subaccount. This function returns only metadata if no other service accounts exist with the same username and domain.
- If one service account uses the same username and domain, the function returns the service account's information.
- If two or more service accounts use the same username and domain, the function returns a hypothetical subaccount.
Note:
A hypothetical subaccount consists of two or more service accounts that use the same username and domain.
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 |
username |
string |
Required The subaccount's username.
|
A username that meets the account name limitations.
Note: This value does not include the domain name. |
example |
domain |
string |
Required The subaccount's associated domain. |
A domain that the cPanel account owns. |
example.com |
Returns
Note:
This function returns only metadata if the specified username and domain do not match any service accounts or hypothetical subaccounts.
Return |
Type |
Description |
Possible values |
Example |
alternate_email |
string |
An alternate email address for the account's user. |
A valid email address. |
user@example.com |
avatar_url |
string |
The user's account profile photo.
|
A valid HTTPS URL that points to an image file. |
|
can_delete |
Boolean |
Whether the cPanel account user can delete the account. |
|
0 |
can_set_password |
Boolean |
Whether the cPanel account user can change the account's password.
|
Note: The function returns 0 for accounts that inherit their password from the cPanel account. |
1 |
can_set_quota |
Boolean |
Whether the cPanel account user can change the account'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 account user's associated domain. |
A domain that the cPanel account owns. |
example.com |
full_username |
string |
The account's username and domain name. |
A valid username, the @ character, and the associated domain. |
user@example.com |
guid |
string |
The accountunique identifier. |
The system-assigned unique value. |
|
issues |
array |
Information about any issues or problems with the account. |
This array includes the type, area, service, message,used, and limit returns. |
|
type |
string |
The type of issue. The function returns this value in the issuesarray. |
|
info |
area |
string |
The affected section of cPanel & WHM. |
quota |
quota |
service |
string |
The affected service. The function returns this value in the issuesarray. |
|
|
message |
string |
The description of the issue. The function returns this value in the issuesarray. |
A string value. |
Your account is over quota. |
used |
integer |
The number of Megabytes (MB) that the account currently uses. The function returns this value in the issuesarray. |
A positive integer. |
2000 |
limit |
integer |
The set quota Megabyte (MB) limit for the affected account. The function returns this value in the issuesarray. |
A positive integer. |
1500 |
merge_candidates |
array |
The service accounts that the system could merge for this account. |
This array includes 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, and username returns. |
|
has_siblings |
Boolean |
Whether the service account shares afull_usernamevalue with another service account. |
|
0 |
parent_type |
string |
The type of account that could own the service account. |
|
hypothetical |
phone_number |
string |
The account user's phone number. |
A valid phone number that conforms to ITU-T's E.164-recommended standard for the representation of telephone numbers. |
+15551234567 |
real_name |
string |
The name of the account's user. |
|
John Doe |
services |
hash |
Information about the account's access to email, FTP, and Web Disk. |
This hash includes the email, ftp, and webdisk returns. |
|
|
hash |
Information that indicates the account's email status. The function returns this value in the serviceshash. |
This hash includes the enabled and quota returns. |
|
enabled |
Boolean |
Whether the account can access Webmail, POP, and IMAP services. The function returns this value in the emailhash. |
|
1 |
quota |
string |
The account's email disk space quota. The function returns this value in the emailhash. |
|
100 |
ftp |
hash |
Information about the account's FTP status. The function returns this value in the serviceshash. |
This hash includes the enabled, quota, and homedirreturns. |
|
enabled |
Boolean |
Whether the account can access FTP. The function returns this value in the ftp hash. |
|
0 |
quota |
integer |
The account's FTP disk space quota. The function returns this value in the ftp hash. |
|
100 |
homedir |
string |
The account's FTP home directory. The function returns this value in the ftp hash. |
A valid path, relative to the cPanel account's home directory. |
/account |
webdisk |
hash |
Information about the account's Web Disk status. The function returns this value in the serviceshash. |
This hash includes the enabled, homedir, perms, andprivate returns. |
|
enabled |
Boolean |
Whether the account can access Web Disk. The function returns this value in the webdiskhash. |
|
0 |
homedir |
string |
The account's Web Disk directory. The function returns this value in the webdiskhash. |
A valid path, relative to the cPanel account's home directory. |
/bob |
perms |
string |
Whether to grant write permissions to the account. The function returns this value in the webdiskhash. |
|
rw |
private |
Boolean |
Whether to set the Web Disk directory's permissions to public or private. The function returns this value in the webdiskhash. |
|
0 |
special |
Boolean |
Whether the account is a system-created special account that the usercannot remove.
|
|
1 |
sub_account_exists |
Boolean |
Whether an account exists with the same username. |
Note: The function returns a null value if the account isnot a service account. |
0 |
synced_password |
Boolean |
Whether the user has synchronized the passwords for each of the account's service accounts. |
Note: The function returns a null value if the account isnot a subaccount. |
0 |
type |
string |
The type of account. |
|
sub |
username |
string |
The account username.
|
A username that meets the account name limitations.
Note: This value does not include the domain name. |
example |