v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Email DNS Settings

Return mail exchanger records

This function lists Mail Exchanger (MX) records.

Important:

When you disable the DNS role, the system disables this function.

get/Email/list_mxs

Query parameters

domainstring domain
Example:example.com

The domain to query. If you do not use this parameter, the function returns MX records for all of the cPanel account's 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_mxs",
  "module": "Email",
  "result": {
    "data": [
      {
        "alwaysaccept": 1,
        "detected": "local",
        "domain": "example.com",
        "entries": [
          {
            "domain": "example.com",
            "entrycount": 1,
            "mx": "mx.example.com",
            "priority": 5,
            "row": "odd"
          }
        ],
        "local": 1,
        "mx": "mx.example.com",
        "mxcheck": "auto",
        "status": 1,
        "statusmsg": "Fetched MX List"
      }
    ],
    "metadata": {
      "transformed": 1
    },
    "status": 1
  }
}