{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendmux-ai/json-schema/sendmux-ai-mailbox-send-policy-response-schema.json",
  "title": "MailboxSendPolicyResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendmux-ai-mailboxes-api-openapi.yml#/components/schemas/MailboxSendPolicyResponse",
  "allOf": [
    {
      "$ref": "#/$defs/SuccessEnvelope"
    },
    {
      "properties": {
        "data": {
          "$ref": "#/$defs/MailboxSendPolicySnapshot"
        },
        "meta": {
          "$ref": "#/$defs/ResponseMeta"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    }
  ],
  "unevaluatedProperties": false,
  "$defs": {
    "MailboxSendPolicy": {
      "additionalProperties": false,
      "properties": {
        "allowed_from": {
          "additionalProperties": false,
          "default": {},
          "description": "Allowed From addresses at this policy level.",
          "properties": {
            "addresses": {
              "default": [],
              "description": "Exact email addresses matched by this rule.",
              "items": {
                "format": "email",
                "maxLength": 254,
                "type": "string"
              },
              "maxItems": 100,
              "type": "array"
            },
            "domains": {
              "default": [],
              "description": "Exact domains; subdomains are not included automatically.",
              "items": {
                "maxLength": 253,
                "pattern": "^(?!-)[a-z0-9-]{1,63}(?<!-)(?:\\.(?!-)[a-z0-9-]{1,63}(?<!-))+$",
                "type": "string"
              },
              "maxItems": 100,
              "type": "array"
            },
            "own_address": {
              "default": true,
              "description": "Allow the originating inbox address.",
              "type": "boolean"
            }
          },
          "type": "object"
        },
        "allowed_reply_to": {
          "additionalProperties": false,
          "default": {},
          "description": "Allowed Reply-To addresses at this policy level.",
          "properties": {
            "addresses": {
              "default": [],
              "description": "Exact email addresses matched by this rule.",
              "items": {
                "format": "email",
                "maxLength": 254,
                "type": "string"
              },
              "maxItems": 100,
              "type": "array"
            },
            "domains": {
              "default": [],
              "description": "Exact domains; subdomains are not included automatically.",
              "items": {
                "maxLength": 253,
                "pattern": "^(?!-)[a-z0-9-]{1,63}(?<!-)(?:\\.(?!-)[a-z0-9-]{1,63}(?<!-))+$",
                "type": "string"
              },
              "maxItems": 100,
              "type": "array"
            },
            "own_address": {
              "default": true,
              "description": "Allow the originating inbox address.",
              "type": "boolean"
            }
          },
          "type": "object"
        },
        "alternate_from": {
          "default": [],
          "description": "Ordered fallback From addresses; every policy level must explicitly allow each alternative.",
          "items": {
            "format": "email",
            "maxLength": 254,
            "type": "string"
          },
          "maxItems": 100,
          "type": "array"
        },
        "recipients": {
          "additionalProperties": false,
          "default": {},
          "description": "Recipient restrictions applied to every To, Cc and Bcc address.",
          "properties": {
            "allow": {
              "additionalProperties": false,
              "default": null,
              "description": "Allowed recipients, or null for no allow-list restriction. An empty rule allows no recipients.",
              "properties": {
                "addresses": {
                  "default": [],
                  "description": "Exact email addresses matched by this rule.",
                  "items": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "maxItems": 100,
                  "type": "array"
                },
                "domains": {
                  "default": [],
                  "description": "Exact domains; subdomains are not included automatically.",
                  "items": {
                    "maxLength": 253,
                    "pattern": "^(?!-)[a-z0-9-]{1,63}(?<!-)(?:\\.(?!-)[a-z0-9-]{1,63}(?<!-))+$",
                    "type": "string"
                  },
                  "maxItems": 100,
                  "type": "array"
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "deny": {
              "additionalProperties": false,
              "default": {},
              "description": "Blocked recipients; deny rules always take precedence.",
              "properties": {
                "addresses": {
                  "default": [],
                  "description": "Exact email addresses matched by this rule.",
                  "items": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "maxItems": 100,
                  "type": "array"
                },
                "domains": {
                  "default": [],
                  "description": "Exact domains; subdomains are not included automatically.",
                  "items": {
                    "maxLength": 253,
                    "pattern": "^(?!-)[a-z0-9-]{1,63}(?<!-)(?:\\.(?!-)[a-z0-9-]{1,63}(?<!-))+$",
                    "type": "string"
                  },
                  "maxItems": 100,
                  "type": "array"
                }
              },
              "type": "object"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "MailboxSendPolicySnapshot": {
      "additionalProperties": false,
      "properties": {
        "policy": {
          "$ref": "#/$defs/MailboxSendPolicy"
        },
        "version": {
          "description": "Current policy version; also returned in ETag.",
          "pattern": "^[a-f0-9]{64}$",
          "type": "string"
        }
      },
      "required": [
        "policy",
        "version"
      ],
      "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"
    }
  }
}