{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postfleet-ai/json-schema/postfleet-ai-update-draft-request-schema.json",
  "title": "UpdateDraftRequest",
  "description": "Omitted fields keep the stored value. `reply_to_message_id` is immutable and rejected if supplied.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postfleet-ai-openapi.json#/components/schemas/UpdateDraftRequest",
  "type": "object",
  "properties": {
    "to": {
      "description": "Replacement recipient or recipients, one address or an array of up to 10.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "minItems": 1,
          "maxItems": 10,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      ]
    },
    "subject": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "attachments": {
      "description": "Replace the draft attachments. Omit to keep the stored files; pass [] to clear them. URL-backed files are stored as the URL and fetched when the draft is sent.",
      "maxItems": 20,
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "filename": {
                "description": "Basename only — no path separators. Derived from the URL path, or `attachment`, when omitted.",
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[^/\\0\\\\]+$"
              },
              "content": {
                "type": "string",
                "minLength": 1,
                "description": "File bytes, standard base64."
              },
              "content_type": {
                "description": "MIME type. Defaults to application/octet-stream, or the URL response Content-Type.",
                "type": "string",
                "maxLength": 127,
                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9!#$&^_.+-]*\\/[a-zA-Z0-9][a-zA-Z0-9!#$&^_.+-]*$"
              }
            },
            "required": [
              "content"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "filename": {
                "description": "Basename only — no path separators. Derived from the URL path, or `attachment`, when omitted.",
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[^/\\0\\\\]+$"
              },
              "url": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "description": "HTTPS URL fetched at send time. Not forwarded to the provider."
              },
              "content_type": {
                "description": "MIME type. Defaults to application/octet-stream, or the URL response Content-Type.",
                "type": "string",
                "maxLength": 127,
                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9!#$&^_.+-]*\\/[a-zA-Z0-9][a-zA-Z0-9!#$&^_.+-]*$"
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "additionalProperties": false
}