{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/volanea-com/json-schema/volanea-com-send-message-schema.json",
  "title": "SendMessage",
  "description": "A single message. Provide inline `html`/`text` content or a `templateId`; `subject` is required unless the template supplies one.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/volanea-com-openapi.json#/components/schemas/SendMessage",
  "type": "object",
  "properties": {
    "to": {
      "description": "Recipient address (optionally with a display name), or an array of 1–50 recipients (each gets its own message).",
      "oneOf": [
        {
          "type": "string",
          "description": "An address, or a display name and address: `\"Ada Lovelace <ada@example.com>\"`."
        },
        {
          "type": "object",
          "properties": {
            "email": {
              "type": "string",
              "format": "email"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "email"
          ]
        },
        {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string",
                "description": "An address, or a display name and address: `\"Ada Lovelace <ada@example.com>\"`."
              },
              {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ]
              }
            ]
          },
          "minItems": 1,
          "maxItems": 50
        }
      ]
    },
    "subject": {
      "type": "string",
      "description": "Subject line. Supports `{{variable}}` placeholders, with fallbacks: `{{firstName | \"there\"}}`."
    },
    "html": {
      "type": "string",
      "description": "HTML body. Supports `{{variable}}` placeholders, with fallbacks: `{{firstName | \"there\"}}`."
    },
    "text": {
      "type": "string",
      "description": "Plain-text body (wrapped in `<pre>` when no HTML is given)."
    },
    "templateId": {
      "type": "string",
      "description": "Send using a stored template instead of inline content."
    },
    "variables": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "description": "Values for `{{variable}}` placeholders in the subject and body. A name you omit falls back to the same-named contact field, then to the placeholder's own `| \"default\"` if it has one, then to nothing."
    },
    "from": {
      "type": "string",
      "description": "From address. Must belong to a verified domain (unless in test mode). Defaults to the template's from address, or hello@ your first verified domain. `\"Acme <hello@acme.com>\"` also works: the name becomes `fromName` unless you send `fromName` yourself."
    },
    "fromName": {
      "type": "string"
    },
    "replyTo": {
      "type": "string",
      "description": "Sets a Reply-To header. An address, or `\"Name <address>\"` (the name is dropped)."
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Custom email headers to include on the message."
    },
    "attachments": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string"
          },
          "content": {
            "type": "string",
            "description": "Base64-encoded file content."
          },
          "contentType": {
            "type": "string",
            "default": "application/octet-stream"
          }
        },
        "required": [
          "filename",
          "content"
        ]
      },
      "description": "Up to 10 attachments per message. Total request size is capped at 10 MiB."
    },
    "sendAt": {
      "type": "string",
      "format": "date-time",
      "description": "Schedule delivery for a future time (ISO 8601 with offset). The message is stored `queued` with a `scheduledFor` — list the pending ones with `GET /v1/emails?status=scheduled`, stop one with `DELETE /v1/emails/{id}`."
    },
    "createContact": {
      "type": "boolean",
      "description": "Set `false` to skip auto-creating a contact for unknown recipients (default `true`)."
    },
    "type": {
      "type": "string",
      "enum": [
        "transactional",
        "marketing"
      ],
      "description": "Marketing messages get the unsubscribe footer and skip contacts who have unsubscribed. Defaults to the template's type, or `transactional` for inline content — so promotional copy sent as inline `html` must set this explicitly or it bypasses the unsubscribe check."
    }
  },
  "required": [
    "to"
  ]
}