{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mepmail-dev/json-schema/mepmail-dev-send-email-request-schema.json",
  "title": "SendEmailRequest",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mepmail-dev-api-openapi.json#/components/schemas/SendEmailRequest",
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "description": "Sender, \"Name <user@domain>\" or bare address; the domain must be verified for the team"
    },
    "to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "maxItems": 50
        }
      ],
      "description": "Recipient address or list of up to 50"
    },
    "subject": {
      "type": "string",
      "minLength": 1,
      "description": "Subject line"
    },
    "html": {
      "type": "string",
      "description": "HTML body; at least one of html/text is required"
    },
    "text": {
      "type": "string",
      "description": "Plain-text body; at least one of html/text is required"
    },
    "cc": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "maxItems": 50
        }
      ],
      "description": "Cc address or list"
    },
    "bcc": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "maxItems": 50
        }
      ],
      "description": "Bcc address or list"
    },
    "reply_to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "maxItems": 50
        }
      ],
      "description": "Reply-To address or list"
    },
    "scheduled_at": {
      "type": "string",
      "description": "Deliver later: ISO 8601 with offset, or relative like \"in 2 hours\" (an ISO 8601 datetime with offset (e.g. \"2026-09-01T12:00:00Z\") or a relative time like \"in 5 mins\", \"in 2 hours\", or \"in 1 day\"); max 30 days ahead"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "value"
        ]
      },
      "description": "Key/value labels attached to the email for filtering"
    },
    "topic_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Topic id: recipients opted out of the topic are skipped and an unsubscribe link is added"
    },
    "attachments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1
          },
          "content": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "content_id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "filename"
        ]
      },
      "description": "Attachments with base64 content (no remote paths)"
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Extra message headers (transport headers are rejected)"
    },
    "template": {
      "description": "Not supported yet: any value is a 422. Send html/text instead"
    }
  },
  "required": [
    "from",
    "to",
    "subject"
  ]
}