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.

Authorizations:
query Parameters
add_www
integer
Default: 0

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.
Enum: 0 1
Example: add_www=1
include_wildcard
integer
Default: 0

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.
Enum: 0 1
Example: include_wildcard=1
select
string <domain>

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

Example: select=example.com

Responses

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object

Request samples

uapi --output=jsonpretty \
  --user=username \
  Email \
  list_mail_domains

Response samples

Content type
application/json
{
  • "apiversion": 3,
  • "func": "list_mail_domains",
  • "module": "Email",
  • "result": {
    • "data": [
      • {
        • "domain": "example.com",
        • "select": 1
        }
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "transformed": 1
      },
    • "status": 1,
    • "warnings": null
    }
}