WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
The country to block. The ISO 3166-1 alpha-2 code two-letter country code.
Warning:
Do not block the ZZ country code if the server uses a NAT configuration.
Note:
- To search all available country codes, read the ISO's Full list of Country Codes documentation.
- To block multiple countries, duplicate or increment the parameter name. For example:
country_code-1,country_code-2, andcountry_code-3.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/block_incoming_email_from_country
- A server running WHM.
https://whm-server.tld:2087/json-api/block_incoming_email_from_country
- 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/block_incoming_email_from_country?country_code=string'{ "data": { "updated": 1 }, "metadata": { "command": "block_incoming_email_from_country", "reason": "OK", "result": 1, "version": 1 } }
The domain to block.
Note:
- The function returns
0for theupdatedreturn if the server already blocks that domain. - An FQDN requires at least a label, a dot (
.), and a top-level domain (TLD). - Enter an asterisk (
*) to represent a wildcard label or TLD. - To block multiple domains, duplicate or increment the parameter name.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/block_incoming_email_from_domain
- A server running WHM.
https://whm-server.tld:2087/json-api/block_incoming_email_from_domain
- 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/block_incoming_email_from_domain?domain=string'{ "data": { "updated": 1 }, "metadata": { "command": "block_incoming_email_from_domain", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_blocked_incoming_email_countries
- A server running WHM.
https://whm-server.tld:2087/json-api/list_blocked_incoming_email_countries
- 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/list_blocked_incoming_email_countries{ "data": { "countries": [ … ] }, "metadata": { "command": "list_blocked_incoming_email_countries", "reason": "OK", "result": 1, "version": 1 } }