Update whitelist / blacklist

Update whitelist / blacklist rules for the specified domain

  • HTTP Method: PUT
  • URL: https://example.domain.tld/api/v1/antispam/wlbl/domain/<domain>/
  • Require authentication: Yes
  • Permission level required: MasterAdmin / DomainAdmin

Path parameters

Parameter Type Description Required
domain str Domain name Required

Request parameters

Parameter Type Description Required
action str whitelist or blacklist Required
sender_domains list List of sender domains to whitelist or blacklist Optional
sender_emails list List of sender emails to whitelist or blacklist Optional
sender_ips list List of sender IPs/CIDRs to whitelist or blacklist Optional

Note

Any one of the above optional parameter is required

Response parameters

Parameter Type Description
action str whitelist or blacklist
domain str Domain name
sender_domains list List of sender domains whitelisted or blacklisted
sender_emails list List of sender emails whitelisted or blacklisted
sender_ips list List of sender IPs/CIDRs whitelisted or blacklisted
status str Status

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/antispam/wlbl/domain/vonmail.com/"
data = {
"action" : "whitelist",
"sender_domains" : ["good-domain.tld", "another-good-domain.tld", "my-external-domain.tld"],
"sender_emails" : ["user@good-domain.tld", "user@another-good-domain.tld", "user@my-external-domain.tld"],
"sender_ips" : ["127.55.120.245", "10.0.0.0/8"]
}
r = requests.put(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except: 
    print(r.text)

Example response (JSON)

{
 'action': 'whitelist',
 'domain': 'vonmail.com',
 'sender_domains': ['good-domain.tld', 'another-good-domain.tld', 'my-external-domain.tld'],
 'sender_emails': ['user@good-domain.tld', 'user@another-good-domain.tld', 'user@my-external-domain.tld'],
 'sender_ips': ['127.55.120.245', '10.0.0.0/8'],
 'status': 'applying'
}