{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/multimail-dev/json-schema/multimail-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/multimail-dev-openapi.yml#/components/schemas/SendEmailRequest",
  "type": "object",
  "required": [
    "to",
    "subject",
    "markdown"
  ],
  "properties": {
    "to": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      },
      "maxItems": 50
    },
    "cc": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "bcc": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "subject": {
      "type": "string",
      "maxLength": 998
    },
    "markdown": {
      "type": "string",
      "maxLength": 262144,
      "description": "Email body in markdown. Converted to HTML."
    },
    "attachments": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "content_base64",
          "content_type"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "content_base64": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          }
        }
      }
    },
    "idempotency_key": {
      "type": "string",
      "description": "Dedup key (24h TTL). If resent within TTL, returns the original email ID."
    },
    "send_at": {
      "type": "string",
      "description": "Schedule delivery for a future time. ISO 8601 UTC (must end with Z). Example: 2026-03-15T14:00:00Z"
    },
    "gate_timing": {
      "type": "string",
      "enum": [
        "gate_first",
        "schedule_first"
      ],
      "description": "Override mailbox default: gate_first approves before scheduling, schedule_first schedules then approves on delivery"
    },
    "ucan": {
      "type": "string",
      "maxLength": 11008,
      "description": "Optional UCAN (base64url) delegating email-send authority from the agent's did:key to MultiMail. Relayed verbatim in the X-Agent-Identity header; MultiMail does not sign or verify it (the recipient does). Only meaningful when the account has a bound agent DID."
    }
  }
}