cPanel WHM icon

cPanel WHM

Full cPanel WHM API — all 622 operations across Accounts, DNS, Mail, SSL, Backups, Databases and more

Actions262

DNS → Create subdomain

AI-generated

Summary

Create a new DNS subdomain on a cPanel WHM managed server, specifying its subdomain name and document root.

Inputs

  • Domain (required) — The name of the subdomain to create.
  • Document Root (required) — The subdomain's document root directory within the user's home directory; must be a valid path or the operation will fail.
  • Use Canonical Name — Optional field to specify whether to use a canonical name in Apache's configuration for self-referential URLs (0 = do not use, 1 = use).

Output shape

the API response from WHM after attempting to create the subdomain, including success status and any error messages

The operation returns the WHM API response body which contains the result of the subdomain creation request. Errors may be returned if the document root is invalid or other WHM constraints are violated.

Links

Discussion