SubDomain

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.

get/SubDomain/delsubdomain

Request

  • Base URL
    https://cpanel-server.tld:2083/execute
  • Auth
    HTTP basic

Query parameters

domainstring required
Example:subdomain_example.com

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.

disallowdot0 | 1
Example:1

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.

Response

HTTP Request was successful.

dataunknown
errorsstring[] nullable
messagesstring[] nullable
status0 | 1
  • 1 — Success.
  • 0 — Failed. Check the errors field for more details.
warningsstring[] nullable

Example response

{
  "status": 1
}

Changes

No recorded changes to this operation across all 5 revisions of this API.