{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postfleet-ai/json-schema/postfleet-ai-draft-schema.json",
  "title": "Draft",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postfleet-ai-openapi.json#/components/schemas/Draft",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "mailbox_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "pending_approval",
        "sending",
        "sent",
        "rejected"
      ]
    },
    "to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "subject": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "reply_to_message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "requires_human": {
      "type": "boolean"
    },
    "thread_id": {
      "type": "string"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "attachments": {
      "description": "Metadata only — file bytes are not returned.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "url": {
            "description": "Present when the draft stored a URL-backed attachment. Bytes are never returned.",
            "type": "string"
          }
        },
        "required": [
          "filename",
          "content_type",
          "size_bytes"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "id",
    "mailbox_id",
    "status",
    "subject",
    "text",
    "requires_human",
    "thread_id",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}