{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/transmitly-io/json-schema/transmitly-io-email-request-schema.json",
  "title": "EmailRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/transmitly-io-openapi.json#/components/schemas/EmailRequest",
  "type": "object",
  "required": [
    "from",
    "to",
    "subject"
  ],
  "properties": {
    "from": {
      "type": "string",
      "description": "Display name optional, e.g. 'Notify <notify@mail.acme.com>'. Domain must be verified."
    },
    "to": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 50
        }
      ]
    },
    "reply_to": {
      "type": "string",
      "maxLength": 320,
      "description": "Optional Reply-To address, display name allowed. Takes precedence over a Reply-To header. Must be a valid email address."
    },
    "subject": {
      "type": "string",
      "maxLength": 500
    },
    "html": {
      "type": "string",
      "maxLength": 1048576
    },
    "text": {
      "type": "string"
    },
    "stream": {
      "type": "string",
      "enum": [
        "transactional",
        "marketing"
      ],
      "default": "transactional"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Additional headers. From, To, Subject, Date, Message-ID and Reply-To are managed by the API."
    },
    "template_id": {
      "type": "string",
      "description": "Resolve subject/html/text from a workspace template"
    },
    "template_data": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Values for {{variable}} placeholders"
    },
    "test_mode": {
      "type": "boolean",
      "description": "Accept and record the message without attempting SMTP delivery"
    },
    "cc": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "bcc": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "scheduled_at": {
      "type": "string",
      "description": "RFC3339 or \"in N minutes/hours/days\""
    },
    "topic": {
      "type": "string"
    },
    "attachments": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "object",
        "required": [
          "filename"
        ],
        "properties": {
          "filename": {
            "type": "string"
          },
          "content": {
            "type": "string",
            "description": "Base64 content"
          },
          "path": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "content_id": {
            "type": "string",
            "description": "Inline CID"
          }
        }
      }
    }
  }
}