{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sending-dev/json-schema/sending-dev-send-message-input-schema.json",
  "title": "SendMessageInput",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sending-dev-openapi.json#/components/schemas/SendMessageInput",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "enum": [
            "email"
          ]
        },
        "to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 50
            }
          ],
          "description": "Email recipients (To header). One or more recipients: 'a@b.com', 'Name <a@b.com>', several comma-separated addresses, or an array."
        },
        "from": {
          "type": "string"
        },
        "subject": {
          "type": "string",
          "minLength": 1
        },
        "html": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1,
              "maxItems": 10
            }
          ],
          "description": "Reply-To: one or more addresses ('a@b.com', 'Name <a@b.com>', comma-separated or an array, at most 10). A plain \"Reply\" goes to all of them."
        },
        "cc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 50
            }
          ],
          "description": "One or more recipients: 'a@b.com', 'Name <a@b.com>', several comma-separated addresses, or an array."
        },
        "bcc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 50
            }
          ],
          "description": "One or more recipients: 'a@b.com', 'Name <a@b.com>', several comma-separated addresses, or an array."
        },
        "templateId": {
          "type": "string",
          "minLength": 1
        },
        "variables": {
          "type": "object",
          "additionalProperties": {}
        },
        "attachments": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "Id of an attachment already uploaded with POST /v1/attachments."
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "File name shown to the recipient. Required with `content` or `url`."
              },
              "content": {
                "type": "string",
                "minLength": 1,
                "description": "File content in base64, without the `data:` prefix."
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Public https URL to download the file from (private hosts are blocked)."
              },
              "contentType": {
                "type": "string",
                "minLength": 3,
                "maxLength": 255,
                "description": "Content-Type override; when absent, it is inferred from the file name."
              },
              "contentId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Content-ID for inline images referenced in the HTML as `cid:<value>`: the attachment becomes `inline` instead of appearing at the end of the message."
              }
            }
          },
          "maxItems": 20,
          "description": "Email attachments (max 20, 10 MB each, 25 MB in total). For each item provide exactly one source: `id`, `content` (base64) or `url`."
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 8
        },
        "disableTracking": {
          "type": "boolean",
          "default": false
        },
        "disableUtm": {
          "type": "boolean",
          "default": false
        }
      },
      "required": [
        "channel",
        "to",
        "from",
        "idempotencyKey"
      ]
    },
    {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "enum": [
            "whatsapp"
          ]
        },
        "to": {
          "type": "string",
          "pattern": "^\\+?\\d{6,15}$"
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "templateId": {
          "type": "string",
          "minLength": 1
        },
        "variables": {
          "type": "object",
          "additionalProperties": {}
        },
        "metaTemplate": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "params": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "language": {
              "type": "string",
              "minLength": 2
            }
          },
          "required": [
            "name"
          ]
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 8
        }
      },
      "required": [
        "channel",
        "to",
        "idempotencyKey"
      ]
    },
    {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "enum": [
            "telegram"
          ]
        },
        "to": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "templateId": {
          "type": "string",
          "minLength": 1
        },
        "variables": {
          "type": "object",
          "additionalProperties": {}
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 8
        }
      },
      "required": [
        "channel",
        "to",
        "idempotencyKey"
      ]
    }
  ]
}