v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Email
Email Accounts

Return cPanel account's mail domains

This function lists the account's mail domains.

Important:

When you disable the Receive Mail role, the system disables this function.

Note:

This function always returns the account's main domain first.

Additional Note:

By default, temporary domains (*.cpanel.site) are excluded. Use the return_temporary_domain parameter to include them.

get/Email/list_mail_domains

Query parameters

add_www0 | 1
Example:1

Whether to list www. addresses.

  • 1 — List www. addresses.
  • 0 — Do not list www. addresses. For example, if you specify 1, the function's output would include both example.com and www.example.com. If you specify 0, the output would include only example.com.
include_wildcard0 | 1
Example:1

Whether to list wildcard addresses.

  • 1 — List wildcard addresses.
  • 0 — Do not list wildcard addresses. For example, if you specify 1, the function's output would include both example.com and *.example.com. If you specify 0, the output would include only example.com.
return_temporary_domainboolean

Whether to include temporary domains (*.cpanel.site) in the output. By default, temporary domains are excluded.

selectstring domain
Example:example.com

The name of the domain that the function returns with the select output parameter. If you do not use this parameter, the function will not return the select parameter with any domains.

Response

HTTP 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": "list_mail_domains",
  "module": "Email",
  "result": {
    "data": [
      {
        "domain": "example.com",
        "select": 1
      }
    ],
    "metadata": {
      "transformed": 1
    },
    "status": 1
  }
}