WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
The domain for which to install an SPF record on the DNS server.
Note:
To install multiple SPF records, increment the parameter name. For example, use the domain-1=example-1.com, domain-2=example-2.com, and domain-3=example3.com parameters.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/install_spf_records
- A server running WHM.
https://whm-server.tld:2087/json-api/install_spf_records
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/install_spf_records?domain=example.com&record=v%253Dspf1%2520%252Bip4%253A1192.0.2.0%2520-all'{ "data": { "payload": [ … ] }, "metadata": { "command": "install_spf_records", "reason": "OK", "result": 1, "version": 1 } }
The domain for which to remove the DMARC record.
Note:
If you do not include this argument, the system will remove all DMARC records from all domains.
To remove 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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/remove_dmarc
- A server running WHM.
https://whm-server.tld:2087/json-api/remove_dmarc
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/remove_dmarc?domain=string'{ "data": { "payload": [ … ] }, "metadata": { "command": "remove_dmarc", "reason": "OK", "result": 1, "version": 1 } }
Request
This function sets the server's default DMARC record.
The system uses the default DMARC record when creating new accounts or applying DMARC policies that don't specify a custom record.
Note:
You can pass an empty string to remove the custom default and revert to the built-in default record.
The DMARC record to set as the server default.
Note:
The record must be a valid DMARC record that starts with v=DMARC1; and contains a policy directive (p=none, p=quarantine, or p=reject).
Pass an empty string to remove the custom default and revert to the built-in default.
Visit the following link for more information about the DMARC record specification: https://dmarc.org/resources/specification/.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/set_default_dmarc_record
- A server running WHM.
https://whm-server.tld:2087/json-api/set_default_dmarc_record
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/set_default_dmarc_record?record=string'{ "data": { "payload": { … } }, "metadata": { "command": "set_default_dmarc_record", "reason": "OK", "result": 1, "version": 1 } }