{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aidelly-ai/json-schema/aidelly-ai-draft-envelope-schema.json",
  "title": "DraftEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aidelly-ai-drafts-api-openapi.yml#/components/schemas/DraftEnvelope",
  "allOf": [
    {
      "$ref": "#/$defs/EnvelopeBase"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "properties": {
            "draft": {
              "$ref": "#/$defs/Draft"
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "Draft": {
      "type": "object",
      "required": [
        "id",
        "text",
        "platform",
        "platforms",
        "media_urls",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "text": {
          "type": "string"
        },
        "platform": {
          "type": "string"
        },
        "platforms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "media_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "draft_kind": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "post",
            "thread"
          ]
        },
        "draft_planned_for": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "ISO 8601 date/time for calendar placement. Does not schedule the draft — drafts never publish."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "EnvelopeBase": {
      "type": "object",
      "required": [
        "success",
        "request_id"
      ],
      "properties": {
        "success": {
          "type": "boolean"
        },
        "request_id": {
          "type": "string",
          "format": "uuid"
        }
      }
    }
  }
}