{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendly-now/json-schema/sendly-now-send-email-v1-schema.json",
  "title": "SendEmailV1",
  "description": "Body for POST /api/v1/emails. Either `template` or `subject`+`body` is required, and `to` names exactly one recipient.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendly-now-openapi.json#/components/schemas/SendEmailV1",
  "properties": {
    "attachments": {
      "items": {
        "properties": {
          "content": {
            "minLength": 1,
            "type": "string"
          },
          "contentId": {
            "maxLength": 255,
            "minLength": 1,
            "pattern": "^[^<>\\r\\n]+$",
            "type": "string"
          },
          "contentType": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          },
          "disposition": {
            "default": "attachment",
            "enum": [
              "attachment",
              "inline"
            ],
            "type": "string"
          },
          "filename": {
            "maxLength": 255,
            "minLength": 1,
            "pattern": "^[^\\r\\n\"]+$",
            "type": "string"
          }
        },
        "required": [
          "filename",
          "content",
          "contentType"
        ],
        "type": "object"
      },
      "maxItems": 10,
      "type": "array"
    },
    "bcc": {
      "items": {
        "format": "email",
        "type": "string"
      },
      "maxItems": 50,
      "type": "array"
    },
    "body": {
      "minLength": 1,
      "type": "string"
    },
    "cc": {
      "items": {
        "format": "email",
        "type": "string"
      },
      "maxItems": 50,
      "type": "array"
    },
    "data": {
      "additionalProperties": {},
      "description": "Arbitrary JSON value (string, number, boolean, null, array, or object).",
      "type": "object"
    },
    "from": {
      "anyOf": [
        {
          "format": "email",
          "type": "string"
        },
        {
          "properties": {
            "email": {
              "format": "email",
              "type": "string"
            },
            "name": {
              "pattern": "^[^\\r\\n]*$",
              "type": "string"
            }
          },
          "required": [
            "email"
          ],
          "type": "object"
        }
      ]
    },
    "headers": {
      "additionalProperties": {
        "maxLength": 998,
        "pattern": "^[^\\r\\n]*$",
        "type": "string"
      },
      "description": "Extra header fields to add to the message, as name → value. A name must be an RFC 5322 field-name (printable ASCII, no spaces or colons) and must not be one Sendly writes itself: From, Sender, Reply-To, To, Cc, Bcc, Subject, Date, Message-ID, MIME-Version, Content-Type, Content-Transfer-Encoding, Content-Disposition, Return-Path, DKIM-Signature, DomainKey-Signature, Received, Authentication-Results, List-Unsubscribe, List-Unsubscribe-Post, and any X-SES-*, X-Sendly-*, Resent-* or ARC-* header. A reserved name, in any letter case, fails validation and nothing is sent.",
      "type": "object"
    },
    "listUnsubscribe": {
      "description": "Your own RFC 8058 one-click unsubscribe endpoint for this recipient. Sendly adds `List-Unsubscribe: <url>` and `List-Unsubscribe-Post: List-Unsubscribe=One-Click`, which is what lets Gmail, Yahoo and Apple Mail show their own Unsubscribe button. The mail client POSTs `List-Unsubscribe=One-Click` to this URL with no cookies and no confirmation page, so it must unsubscribe on that request alone and should carry a token that identifies the recipient. Must be https. Use it for opt-out mail you manage yourself, such as notifications; Sendly's own campaigns and workflows already carry one.",
      "format": "uri",
      "maxLength": 2048,
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "reply": {
      "format": "email",
      "type": "string"
    },
    "subject": {
      "maxLength": 998,
      "minLength": 1,
      "pattern": "^[^\\r\\n]*$",
      "type": "string"
    },
    "subscribed": {
      "type": "boolean"
    },
    "tags": {
      "items": {
        "maxLength": 64,
        "minLength": 1,
        "pattern": "^[a-zA-Z0-9_-]+$",
        "type": "string"
      },
      "maxItems": 10,
      "type": "array"
    },
    "template": {
      "format": "uuid",
      "type": "string"
    },
    "to": {
      "anyOf": [
        {
          "format": "email",
          "type": "string"
        },
        {
          "properties": {
            "email": {
              "format": "email",
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "email"
          ],
          "type": "object"
        }
      ],
      "description": "The single recipient. Use `cc`/`bcc` to copy others on the same message."
    }
  },
  "required": [
    "to"
  ],
  "type": "object"
}