# Delete Subaccount

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.
* This function returns only metadata if the specified username and domain do not match any service accounts or hypothetical Subaccounts.

Endpoint: GET /UserManager/delete_user
Version: 11.138.0.10
Security: BasicAuth

## Query parameters:

  - `domain` (string, required)
    The Subaccount's associated domain.  The domain must be one that the cPanel account owns.
    Example: "example.com"

  - `username` (string, required)
    The Subaccount's username.
* Characters — a-z, A-Z, 0-9, dot (.), hyphen (-), underscore (_)

Note:

This value does not include the domain name.
    Example: "example"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "delete_user"

  - `module` (string)
    The name of the module called.
    Example: "UserManager"

  - `result` (object)

  - `result.data` (object)

  - `result.data.alternate_email` (string)
    An alternate email address for the account's user.
    Example: "user@example.com"

  - `result.data.avatar_url` (string)
    The user's account profile photo.  The URL must point to an image file.
    Example: "https://img.example.com/avatars/example.jpg"

  - `result.data.can_delete` (integer)
    Whether the cPanel account user can delete the account.
* 1 - Can delete.
* 0 - Cannot delete.
    Enum: 0, 1

  - `result.data.can_set_password` (integer)
    Whether the cPanel account user can change the account's password.
* 1 - Can change password.
* 0 - Cannot change password.

Note:

The function returns 0 for accounts that inherit their password from the cPanel account.
    Enum: 0, 1

  - `result.data.can_set_quota` (integer)
    Whether the cPanel account user can change the account's disk usage quota.
* 1 - Can change quota.
* 0 - Cannot change quota.
    Enum: 0, 1

  - `result.data.dismissed` (integer)
    Whether the cPanel account user dismissed the merge prompt for the service account.
* 1 - Dismissed prompt.
* 0 - Did not dismiss prompt.

Note:

Only service accounts return this value.
    Enum: 0, 1

  - `result.data.dismissed_merge_candidates` (array)
    An array of objects that represent the service accounts that the user dismissed the merge prompt for.
This array will always return empty.

Note:

We reserved this return for future use.

  - `result.data.domain` (string)
    The account user's associated domain.
    Example: "example.com"

  - `result.data.full_username` (string)
    The account's username and domain name, separated by the @ character.
    Example: "user@example.com"

  - `result.data.guid` (string)
    The account unique identifier.
    Example: "N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4"

  - `result.data.has_expired_invite` (integer)
    Whether the Subaccount owns an expired invitation.
* 1 - Owns an expired invitation.
* 0 - Does not own an expired invitation.
    Enum: 0, 1

  - `result.data.has_invite` (integer)
    Whether the Subaccount owns an active invitation.
* 1 - Owns an invitation.
* 0 - Does not own an invitation.
    Enum: 0, 1

  - `result.data.has_siblings` (integer)
    Whether the service account shares a full_username value with another service account.
* 1 - Shares.
* 0 - Does not share.
    Enum: 0, 1

  - `result.data.invite_expiration` (integer,null)
    The time at which the new Subaccount invitation will expire, given as a valid Unix epoch time or null.

If the account does not own an active invitation, this value returns null.
    Example: 1466258282

  - `result.data.issues` (array)
    Information about any issues or problems with the account.

  - `result.data.issues.area` (string)
    The affected section of cPanel & WHM.
    Example: "quota"

  - `result.data.issues.limit` (integer)
    The set quota megabyte (MB) limit for the affected account.
    Example: 1500

  - `result.data.issues.message` (string)
    The description of the issue.
    Example: "Your account is over quota."

  - `result.data.issues.service` (string)
    The affected service.
* email
* ftp
* webdisk
    Enum: "email", "ftp", "webdisk"

  - `result.data.issues.type` (string)
    The type of issue.
* error
* warning
* info
    Enum: "error", "warning", "info"

  - `result.data.issues.used` (integer)
    The number of megabytes (MB) that the account currently uses.
    Example: 2000

  - `result.data.merge_candidates` (array)
    The service accounts that the system could merge for this account.

Note:

You can find descriptions for this array's returns within this table.

  - `result.data.merge_candidates.alternate_email` (string)

  - `result.data.merge_candidates.avatar_url` (string)

  - `result.data.merge_candidates.can_delete` (integer)

  - `result.data.merge_candidates.can_set_password` (integer)

  - `result.data.merge_candidates.can_set_quota` (integer)

  - `result.data.merge_candidates.dismissed` (integer)

  - `result.data.merge_candidates.dismissed_merge_candidates` (array)

  - `result.data.merge_candidates.domain` (string)

  - `result.data.merge_candidates.full_username` (string)

  - `result.data.merge_candidates.guid` (string)

  - `result.data.merge_candidates.has_expired_invite` (integer)

  - `result.data.merge_candidates.has_invite` (integer)

  - `result.data.merge_candidates.has_siblings` (integer)

  - `result.data.merge_candidates.invite_expiration` (integer)

  - `result.data.merge_candidates.issues` (array)

  - `result.data.merge_candidates.merge_candidates` (array)

  - `result.data.merge_candidates.parent_type` (string)

  - `result.data.merge_candidates.phone_number` (string)

  - `result.data.merge_candidates.real_name` (string)

  - `result.data.merge_candidates.services` (object)

  - `result.data.merge_candidates.special` (integer)

  - `result.data.merge_candidates.sub_account_exists` (integer)

  - `result.data.merge_candidates.synced_password` (integer)

  - `result.data.merge_candidates.type` (string)

  - `result.data.merge_candidates.username` (string)

  - `result.data.parent_type` (string,null)
    The type of account that could own the service account.
* sub - An account.
* hypothetical - A hypothetical account does not yet exist, but that the user could create as part of a merge.
* null - Not a merge candidate.
    Enum: "sub", "hypothetical"

  - `result.data.phone_number` (string)
    The account user's phone number.
* A valid phone number that conforms to [ITU-T](https://en.wikipedia.org/wiki/ITU-T)'s [E.164-recommended standard](https://en.wikipedia.org/wiki/E.164) for the representation of telephone numbers.
    Example: "+15551234567"

  - `result.data.real_name` (string)
    The name of the account's user.
* A first name, a last name, or a first name and last name.
* An empty string.
    Example: "John Doe"

  - `result.data.services` (object)
    Information about the account's access to email, FTP, and Web Disk.

  - `result.data.services.email` (object)
    Information that indicates the account's email status.

  - `result.data.services.email.enabled` (integer)
    Whether the account can access Webmail, POP, and IMAP services.
* 1 - Can access.
* 0 - Cannot access.
    Enum: 1, 0

  - `result.data.services.email.quota` (integer)
    The account's email disk space quota.
* The set quota megabyte (MB) limit for the account's email disk space.
* 0 - Unlimited.
    Example: 100

  - `result.data.services.ftp` (object)
    Information about the account's FTP status.

  - `result.data.services.ftp.enabled` (integer)
    Whether the account can access FTP.
* 1 - Can access.
* 0 - Cannot access.
    Enum: 1, 0

  - `result.data.services.ftp.homedir` (string)
    The account's FTP home directory.
* A valid path, relative to the cPanel account's home directory.
    Example: "/account"

  - `result.data.services.ftp.quota` (integer)
    The account's FTP disk space quota.
* An integer that represents the account's maximum FTP disk usage, in megabytes (MB).
* 0 - Unlimited.
    Example: 100

  - `result.data.services.webdisk` (object)
    Information about the account's Web Disk status.

  - `result.data.services.webdisk.enabled` (integer)
    Whether the account can access Web Disk.
* 1 - Can access.
* 0 - Cannot access.
    Enum: 1, 0

  - `result.data.services.webdisk.homedir` (string)
    The account's Web Disk directory.
* A valid path, relative to the cPanel account's home directory.
    Example: "/bob"

  - `result.data.services.webdisk.perms` (string)
    Whether to grant write permissions to the account.
* ro - Read-only permissions.
* rw - Read and write permissions.
    Example: "rw"

  - `result.data.services.webdisk.private` (integer)
    Whether to set the Web Disk directory's permissions to public or private.
* 1 - Private (0700).
* 0 - Public (0755).
    Enum: 1, 0

  - `result.data.special` (integer)
    Whether the account is a system-created special account that the user cannot remove.
* 1 - A special account.
* 0 - Not a special account.
    Enum: 1, 0

  - `result.data.sub_account_exists` (integer,null)
    Whether an account exists with the same username.
* 1 - Exists.
* 0 - Does not exist.
* null - The account is not a service account.
    Enum: 1, 0

  - `result.data.synced_password` (integer,null)
    Whether the user has synchronized the passwords for each of the account's service accounts.
* 1 - Synchronized.
* 0 - Not synchronized.
* null - The account is not a Subaccount
    Enum: 1, 0

  - `result.data.type` (string)
    The type of account.
* hypothetical - A hypothetical account that does not exist, but that the user could create as part of a merge.
* service - A service account.
    Enum: "hypothetical", "service"

  - `result.data.username` (string)
    The account username.

The username must meet the account name limitations.
* Characters - a-z, A-Z, 0-9, dot (.), hyphen (-), underscore (_)

Note::

This value does not include the domain name.

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    * 1 - Success
* 0 - Failed: Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


