{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendmux-ai/json-schema/sendmux-ai-set-filter-state-body-schema.json",
  "title": "SetFilterStateBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendmux-ai-domain-filters-api-openapi.yml#/components/schemas/SetFilterStateBody",
  "additionalProperties": false,
  "properties": {
    "mode": {
      "enum": [
        "off",
        "allowlist",
        "denylist"
      ],
      "type": "string"
    },
    "rules": {
      "description": "Replacement rule set. Maximum 1000 rules per request. An empty array is valid (no rules).",
      "items": {
        "$ref": "#/$defs/FilterRule"
      },
      "maxItems": 1000,
      "type": "array"
    }
  },
  "required": [
    "mode",
    "rules"
  ],
  "type": "object",
  "$defs": {
    "FilterRule": {
      "additionalProperties": false,
      "properties": {
        "note": {
          "description": "Free-form caption for the rule (≤255 chars). UI-only metadata — never consulted at match time. `null` when absent.",
          "maxLength": 255,
          "type": [
            "string",
            "null"
          ]
        },
        "pattern": {
          "description": "Email address or bare domain name. Validated against RFC 5321/1035 regexes. The `*@domain` wildcard spelling is accepted and normalised to the bare domain (matching is by exact address or sender domain).",
          "type": "string"
        },
        "type": {
          "description": "Rule type",
          "enum": [
            "allow",
            "deny"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "pattern"
      ],
      "type": "object"
    }
  }
}