# Remove a subdomain

This function removes a subdomain from the cPanel account.

Important:

- If any addon domain is parked on the subdomain, the system refuses to
  remove it and names the addon domains in the errors field. Remove
  those addon domains first with the
  AddonDomain::deladdondomain function.
- This function does not remove the subdomain's document root or the
  files in it.

When you disable the Web Server role,
the system disables this function.

Endpoint: GET /SubDomain/delsubdomain
Version: 11.138.0.19
Security: BasicAuth

## Query parameters:

  - `domain` (string, required)
    The subdomain to remove. Give this value either as the underscore-separated subdomain_rootdomain form that the SubDomain::listsubdomains function returns in its domainkey field, or as a fully qualified domain name.
    Example: "subdomain_example.com"

  - `disallowdot` (integer)
    Whether to remove the dot (.) characters from the subdomain label in the domain value.
* 1 - Remove dots from the subdomain label.
* 0 - Do not remove dots from the subdomain label.
    Enum: 0, 1

## Response 200 fields (application/json):

  - `data` (any)
    This function does not return data. Check the status field for the outcome, and the messages and errors fields for detail.

  - `errors` (array,null)

  - `messages` (array,null)

  - `metadata` (object)

  - `metadata.transformed` (integer)

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

  - `warnings` (array,null)


