v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Domain

Rename a primary, addon, or alias domain

This function renames a primary domain, addon domain, or alias domain on a cPanel account. The system updates all relevant configuration files, document root paths, and DNS entries automatically.

Note:

  • You cannot rename a domain while another rename operation is in progress.
  • You cannot rename the server hostname.
  • The new domain must not already be configured on the account.
post/Domain/rename_domain

Query parameters

domainstring domain required
Example:old.example.com

The current domain name to rename.

new_domainstring domain required
Example:new.example.com

The new domain name.

docrootstring
Example:new.example.com

The path to the domain's document root directory. If you do not specify a value, this parameter defaults to the new domain name.

Response

Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "rename_domain",
  "module": "Domain",
  "result": {
    "data": {
      "message": "Domain old.example.com successfully renamed to new.example.com"
    },
    "status": 1
  }
}