{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendmux-ai/json-schema/sendmux-ai-filter-state-response-schema.json",
  "title": "FilterStateResponse",
  "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/FilterStateResponse",
  "allOf": [
    {
      "$ref": "#/$defs/SuccessEnvelope"
    },
    {
      "properties": {
        "data": {
          "$ref": "#/$defs/FilterState"
        },
        "meta": {
          "$ref": "#/$defs/ResponseMeta"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    }
  ],
  "unevaluatedProperties": false,
  "$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"
    },
    "FilterState": {
      "additionalProperties": false,
      "properties": {
        "mode": {
          "description": "Active filtering mode. `off` disables filtering (all senders accepted). `allowlist` only accepts senders matching a rule. `denylist` blocks senders matching a rule.",
          "enum": [
            "off",
            "allowlist",
            "denylist"
          ],
          "type": "string"
        },
        "rules": {
          "description": "Current rules, sorted by pattern ascending",
          "items": {
            "$ref": "#/$defs/FilterRule"
          },
          "type": "array"
        }
      },
      "required": [
        "mode",
        "rules"
      ],
      "type": "object"
    },
    "ResponseMeta": {
      "additionalProperties": false,
      "properties": {
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "request_id"
      ],
      "type": "object"
    },
    "SuccessEnvelope": {
      "properties": {
        "meta": {
          "additionalProperties": {},
          "properties": {},
          "type": "object"
        },
        "ok": {
          "enum": [
            true
          ],
          "type": "boolean"
        }
      },
      "required": [
        "ok",
        "meta"
      ],
      "type": "object"
    }
  }
}