{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anjal-app/json-schema/anjal-app-draft-input-schema.json",
  "title": "DraftInput",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anjal-app-openapi.yaml#/components/schemas/DraftInput",
  "type": "object",
  "properties": {
    "to": {
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      ]
    },
    "cc": {
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      ]
    },
    "bcc": {
      "oneOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          }
        }
      ]
    },
    "subject": {
      "type": "string"
    },
    "plainBody": {
      "type": "string"
    },
    "htmlBody": {
      "type": "string"
    },
    "replyToMessageId": {
      "type": "string",
      "format": "uuid"
    },
    "labels": {
      "$ref": "#/$defs/Labels"
    },
    "sendAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Schedule the send: ISO 8601 with an offset, e.g.\n`2026-10-01T09:00:00-04:00`. Must be in the future and at most 90\ndays ahead. A scheduled draft needs at least one recipient and a\nbody. On update, `null` cancels the schedule. Anjal checks for due\ndrafts about every 20 seconds. If the send fails, the draft is\nkept, `sendError` is set, `sendAt` is cleared and\n`draft.send_failed` fires.\n"
    }
  },
  "$defs": {
    "Labels": {
      "description": "Labels as an array or a comma-separated string. Stored lowercase and\ndeduplicated; at most 32 labels of at most 64 characters, no commas.\n",
      "oneOf": [
        {
          "type": "array",
          "maxItems": 32,
          "items": {
            "type": "string",
            "maxLength": 64
          }
        },
        {
          "type": "string"
        }
      ]
    }
  }
}