Email Security

Create an email security rule

Changed on

Creates one enabled allow-list or deny-list rule. Requires EMAIL_SECURITY_WRITE. DMI_HEADER rules require header conditions and the ALLOW list. Deny and IP rules always use NONE authentication; DMI_HEADER uses AUTHENTICATED. Domain and email allow rules preserve the requested authentication requirement. IP ranges are canonicalized. Existing rules on either list cause a conflict. Returns the same rule representation as the list endpoint. Fields use snake_case.

Required permission: email_security:write

post/v2/email-security/settings/rules

Request

  • Base URL
    https://api.adaptivesecurity.com
  • URL
    https://api.adaptivesecurity.com/v2/email-security/settings/rules
  • Auth
    HTTP bearer

Request body

auth_requirement'AUTHENTICATED' | 'NONE' required

Sender authentication requirement. list_type 'DENY' rules are always NONE, rule_type DMI_HEADER is always AUTHENTICATED

list_type'ALLOW' | 'DENY' required

Allow or deny matching mail

namestring

Display name for the rule

rule_type'DMI_HEADER' | 'DOMAIN' | 'EMAIL' | 'IP' | 'IP_RANGE' required

Kind of sender match

valuestring required

Value to match; ignored for DMI_HEADER

Example request

{
  "auth_requirement": "AUTHENTICATED",
  "header_rules": {
    "operator": "AND",
    "rules": [
      {
        "header": "X-Partner",
        "value": "trusted",
        "value_type": "STATIC"
      }
    ]
  },
  "list_type": "ALLOW",
  "name": "My custom rule",
  "rule_type": "DOMAIN",
  "value": "example.com"
}

Response

Rule created

auth_requirement'AUTHENTICATED' | 'NONE' required

Sender authentication requirement

createdstring date-time required

Creation time

idstring uuid required

Rule identifier

list_type'ALLOW' | 'DENY' required

Whether the rule allows or denies matching mail

namestring required

Display name

rule_type'DMI_HEADER' | 'DOMAIN' | 'EMAIL' | 'IP' | 'IP_RANGE' required

Kind of sender match

updatedstring date-time required

Last update time

valuestring required

Value matched by the rule

Example response

{
  "auth_requirement": "AUTHENTICATED",
  "created": "2026-09-22T14:00:00Z",
  "header_rules": {
    "operator": "AND",
    "rules": [
      {
        "header": "X-Partner",
        "value": "trusted",
        "value_type": "STATIC"
      }
    ]
  },
  "id": "a785a60e-a8ba-4750-8607-e9e977b9e0c4",
  "list_type": "ALLOW",
  "name": "My custom rule",
  "rule_type": "DOMAIN",
  "updated": "2026-09-23T15:00:00Z",
  "value": "example.com"
}

Changes

    • breaking

      the request property became not nullable

    • breaking

      added subschema #2 to the response property oneOf list for the response status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • warning

      removed the request property /

    • warning

      removed the request property /

    • info

      added subschema #2 to the request property oneOf list

    • info

      endpoint added