v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
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

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.

{"stackTrail":"paths:/SubDomain/delsubdomain:get:responses:200:content:application/json:schema:properties:data","oasType":"schema","type":"unknown","description":"This function does not return data. Check the `status` field for the outcome, and the `messages` and `errors` fields for detail."}
errorsstring[] nullable
messagesstring[] nullable
status0 | 1
  • 1 — Success.
  • 0 — Failed. Check the errors field for more details.
warningsstring[] nullable

Example response

{
  "status": 1
}