{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailjunky-ai/json-schema/mailjunky-ai-send-email-request-schema.json",
  "title": "SendEmailRequest",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mailjunky-ai-openapi.json#/components/schemas/SendEmailRequest",
  "type": "object",
  "required": [
    "from",
    "to",
    "subject"
  ],
  "properties": {
    "from": {
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "object",
          "required": [
            "email"
          ],
          "properties": {
            "email": {
              "type": "string",
              "format": "email"
            },
            "name": {
              "type": "string"
            }
          }
        }
      ],
      "description": "Sender email address or object with email and display name"
    },
    "to": {
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      ],
      "description": "Recipient email address(es)"
    },
    "cc": {
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      ],
      "description": "CC recipient(s)"
    },
    "bcc": {
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      ],
      "description": "BCC recipient(s)"
    },
    "subject": {
      "type": "string",
      "minLength": 1,
      "maxLength": 998,
      "description": "Email subject line"
    },
    "html": {
      "type": "string",
      "description": "HTML body. Either `html` or `text` is required."
    },
    "text": {
      "type": "string",
      "description": "Plain text body. Either `html` or `text` is required."
    },
    "reply_to": {
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      ],
      "description": "Reply-to address(es)"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Tags for categorization and filtering"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Custom key-value metadata"
    },
    "category": {
      "type": "string",
      "enum": [
        "TRANSACTIONAL",
        "WELCOME",
        "MARKETING",
        "NOTIFICATION",
        "NEWSLETTER",
        "CUSTOM"
      ],
      "description": "Email category for analytics"
    }
  }
}