{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/senderkit-com/json-schema/senderkit-com-raw-email-send-schema.json",
  "title": "RawEmailSend",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/senderkit-com-openapi.yaml#/components/schemas/RawEmailSend",
  "type": "object",
  "required": [
    "channel",
    "content",
    "to"
  ],
  "properties": {
    "channel": {
      "type": "string",
      "const": "email"
    },
    "to": {
      "type": "string"
    },
    "from": {
      "type": "string",
      "format": "email",
      "description": "Optional From address override (bare address — put the display name\nin `fromName`). Defaults to the provider connection's address. On\nmanaged sending it is honored only when the address is on the\nworkspace's verified sending domain.\n"
    },
    "fromName": {
      "type": "string",
      "maxLength": 128,
      "description": "Optional From display name override, rendered as `Name <address>`.\nDefaults to the provider connection's from name. Must not contain\ncontrol characters or angle brackets.\n"
    },
    "interpolate": {
      "type": "boolean",
      "default": false,
      "description": "When true, `vars` are interpolated into the inline content."
    },
    "content": {
      "type": "object",
      "required": [
        "subject",
        "html"
      ],
      "properties": {
        "subject": {
          "type": "string"
        },
        "preheader": {
          "type": "string"
        },
        "html": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "cc": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        },
        "bcc": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        },
        "replyTo": {
          "type": "string",
          "format": "email"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Attachment"
          }
        }
      }
    },
    "vars": {
      "type": "object",
      "additionalProperties": true
    },
    "metadata": {
      "$ref": "#/$defs/Metadata"
    },
    "scheduledAt": {
      "type": "string",
      "format": "date-time",
      "description": "Optional ISO-8601 timestamp to schedule the send for later. Must be\nin the future and within 30 days. When provided, the send is\naccepted with `status: \"scheduled\"` and dispatched at that time.\n"
    }
  },
  "$defs": {
    "Attachment": {
      "type": "object",
      "required": [
        "filename",
        "contentType",
        "content"
      ],
      "properties": {
        "filename": {
          "type": "string",
          "maxLength": 255
        },
        "contentType": {
          "type": "string"
        },
        "content": {
          "type": "string",
          "format": "byte",
          "description": "Base64-encoded bytes."
        },
        "inline": {
          "type": "boolean",
          "default": false,
          "description": "When true, attachment is referenced from HTML via `cid:<contentId>`."
        },
        "contentId": {
          "type": "string",
          "description": "Required when `inline=true`."
        }
      },
      "description": "Up to 50 attachments per message, 10 MB total decoded size across all\nattachments. Larger messages are rejected with `attachment_too_large`.\n"
    },
    "Metadata": {
      "type": "object",
      "description": "Caller-supplied tags/IDs. Values must be string, number, or boolean.",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      }
    }
  }
}