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.
SecurityBasicAuth
Request
query Parameters
domain
required
string <domain>

The Subaccount's associated domain. The domain must be one that the cPanel account owns.

Example: domain=example.com
username
required
string <= 64 characters

The Subaccount's username.

  • Characters — a-z, A-Z, 0-9, dot (.), hyphen (-), underscore (_)

Note:

This value does not include the domain name.

Example: username=example
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/UserManager/delete_user
Request samples
uapi --output=jsonpretty \
  --user=username \
  UserManager \
  delete_user \
  username='example' \
  domain='example.com'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "delete_user",
  • "module": "UserManager",
  • "result": {
    • "data": {
      • "alternate_email": "user@example.com",
      • "can_delete": 0,
      • "can_set_password": 1,
      • "can_set_quota": 0,
      • "dismissed": 1,
      • "dismissed_merge_candidates": [
        • { }
        ],
      • "domain": "example.com",
      • "full_username": "user@example.com",
      • "guid": "N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4",
      • "has_expired_invite": 0,
      • "has_invite": 0,
      • "has_siblings": 0,
      • "invite_expiration": 1466258282,
      • "issues": [
        • {
          • "area": "quota",
          • "limit": 1500,
          • "message": "Your account is over quota.",
          • "service": "email",
          • "type": "info",
          • "used": 2000
          }
        ],
      • "merge_candidates": [
        • {
          • "alternate_email": "string",
          • "avatar_url": "string",
          • "can_delete": 0,
          • "can_set_password": 0,
          • "can_set_quota": 0,
          • "dismissed": 0,
          • "dismissed_merge_candidates": [
            • "string"
            ],
          • "domain": "string",
          • "full_username": "string",
          • "guid": "string",
          • "has_expired_invite": 0,
          • "has_invite": 0,
          • "has_siblings": 0,
          • "invite_expiration": 0,
          • "issues": [
            • "string"
            ],
          • "merge_candidates": [
            • "string"
            ],
          • "parent_type": "string",
          • "phone_number": "string",
          • "real_name": "string",
          • "services": { },
          • "special": 0,
          • "sub_account_exists": 0,
          • "synced_password": 0,
          • "type": "string",
          • "username": "string"
          }
        ],
      • "parent_type": "hypothetical",
      • "phone_number": "+15551234567",
      • "real_name": "John Doe",
      • "services": {
        • "email": {
          • "enabled": 1,
          • "quota": 100
          },
        • "ftp": {
          • "enabled": 0,
          • "homedir": "/account",
          • "quota": 100
          },
        • "webdisk": {
          • "enabled": 0,
          • "homedir": "/bob",
          • "perms": "rw",
          • "private": 0
          }
        },
      • "special": 1,
      • "sub_account_exists": 0,
      • "synced_password": 0,
      • "type": "service",
      • "username": "string"
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}