Apply a DMARC record to a domain

This function applies a DMARC record to the specified domain(s).

SecurityBasicAuth
Request
query Parameters
policy
required
string

The DMARC record to apply to the requested domains.

Note:

When using multiple policies, each policy must have a matching domain.

When using a single policy, it will be applied to all specified domains.

Visit the following link for more information about the DMARC record specification: https://dmarc.org/resources/specification/

Examples:
policy=policy="v=DMARC1; p=none;" policy="v=DMARC1; p=reject;" policy="v=DMARC1; p=quarantine;"
policy=policy="v=DMARC1;p=reject;pct=100;rua=mailto:postmaster@example.com"
domain
string

The domain for which to apply the DMARC record.

Note:

To apply multiple domain DMARC records, duplicate the parameter name. For example, use the domain=example-1.com, domain=example-2.com, and domain=example-3.com parameters.

If you do not include this argument, the system applies the DMARC record to all domains on the system.

Examples:
domain=domain=example-1.com domain=example-2.com domain=example-3.com
domain=example.com
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/apply_dmarc
Request samples
whmapi1 --output=jsonpretty \
  apply_dmarc \
  domain='example.com' \
  policy='v=DMARC1; p=reject;'
Response samples
application/json
{
  • "data": {
    • "payload": [
      • {
        • "domain": "example.com",
        • "msg": "[ADD:TXT@_dmarc.example.com:v=DMARC1; p=reject;]",
        • "status": 1
        }
      ]
    },
  • "metadata": {
    • "command": "apply_dmarc",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}