{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eusend-dev/json-schema/eusend-dev-send-email-request-schema.json",
  "title": "SendEmailRequest",
  "description": "A single message. At least one of `html`, `text` or `template_id` is required. Unknown properties are rejected.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eusend-dev-openapi.json#/components/schemas/SendEmailRequest",
  "type": "object",
  "required": [
    "from",
    "to"
  ],
  "additionalProperties": false,
  "properties": {
    "from": {
      "type": "string",
      "description": "Sender address, bare (`hello@acme.com`) or with a display name (`Acme <hello@acme.com>`). The domain must be verified on your account."
    },
    "to": {
      "$ref": "#/$defs/EmailAddresses"
    },
    "cc": {
      "$ref": "#/$defs/EmailAddresses"
    },
    "bcc": {
      "$ref": "#/$defs/EmailAddresses"
    },
    "reply_to": {
      "$ref": "#/$defs/EmailAddresses"
    },
    "subject": {
      "type": "string",
      "minLength": 1,
      "description": "Line breaks are rejected."
    },
    "html": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "template_id": {
      "type": "string",
      "format": "uuid",
      "description": "Render a stored template instead of inline `html`/`text`."
    },
    "variables": {
      "type": "object",
      "additionalProperties": true,
      "description": "Values substituted into the template or into `{{placeholders}}` in the body."
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Extra MIME headers. Line breaks in names or values are rejected."
    },
    "tags": {
      "$ref": "#/$defs/Tags"
    },
    "track_opens": {
      "type": "boolean",
      "description": "Overrides the organization default."
    },
    "track_clicks": {
      "type": "boolean",
      "description": "Overrides the organization default."
    },
    "attachments": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/Attachment"
      }
    },
    "scheduled_at": {
      "type": "string",
      "maxLength": 100,
      "description": "Send in the future, at most 30 days out. An ISO 8601 timestamp or natural language (`in 1 hour`, `tomorrow at 9am`). Relative phrasings resolve against the server clock in UTC."
    }
  },
  "$defs": {
    "Attachment": {
      "type": "object",
      "description": "One file on a message. Supply exactly one of `content` (inline base64) or `path` (a URL fetched at send time). Up to 20 attachments, 10 MB combined.",
      "required": [
        "filename"
      ],
      "properties": {
        "filename": {
          "type": "string",
          "maxLength": 256,
          "description": "Name the recipient sees."
        },
        "content": {
          "type": "string",
          "format": "byte",
          "description": "Base64-encoded file bytes."
        },
        "path": {
          "type": "string",
          "format": "uri",
          "maxLength": 2048,
          "description": "Public URL the server fetches at send time."
        },
        "content_type": {
          "type": "string",
          "maxLength": 255,
          "description": "MIME type; inferred from the filename when omitted."
        },
        "content_id": {
          "type": "string",
          "maxLength": 128,
          "description": "Content-ID for an inline attachment, referenced from HTML as `cid:<content_id>`."
        }
      }
    },
    "EmailAddresses": {
      "description": "A single address, or a list of them. Accepts `Name <user@example.com>` form.",
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      ]
    },
    "Tags": {
      "description": "Labels for log filtering and webhook routing. Accepts a flat object or Resend’s `[{ name, value }]` array; responses always use the object form. Up to 10 tags; names and values are ASCII letters, digits, underscores and dashes.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        {
          "type": "array",
          "maxItems": 10,
          "items": {
            "type": "object",
            "required": [
              "name",
              "value"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          }
        }
      ]
    }
  }
}