{
  "openapi": "3.1.0",
  "info": {
    "title": "Project Planetera Editorial Draft API",
    "description": "API untuk membuat dan mengelola draf berita sementara dari AI eksternal ke meja redaksi Planetera.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://www.planetera.site"
    }
  ],
  "paths": {
    "/api/drafts": {
      "post": {
        "summary": "Buat Draf Berita Baru dari AI",
        "description": "Menyimpan draf berita sementara dengan 14 langkah validasi redaksi, 4 pilar, dan kartu grafis. Draf otomatis aktif selama 24 jam.",
        "operationId": "createDraftArticle",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["title", "summary", "paragraphs"],
                "properties": {
                  "title": { "type": "string", "description": "Judul lengkap berita" },
                  "subheadline": { "type": "string", "description": "Penjelasan satu kalimat kunci" },
                  "category": { "type": "string", "enum": ["BUMI", "LAUTAN", "IKLIM", "HUTAN", "KEHIDUPAN", "AIR", "ENERGI", "BENCANA", "ATMOSFER", "RUANG & SATELIT", "KEBIJAKAN"] },
                  "assessment": { "type": "string", "enum": ["BERITA BAIK", "BERITA NETRAL", "BERITA BURUK"] },
                  "image": { "type": "string", "description": "URL gambar beresolusi tinggi (HTTP 200 OK)" },
                  "language": { "type": "string", "enum": ["id", "en"], "default": "id" },
                  "author": { "type": "string", "default": "External AI Contributor" },
                  "summary": {
                    "type": "object",
                    "properties": {
                      "what": { "type": "string" },
                      "why": { "type": "string" },
                      "soWhat": { "type": "string" },
                      "nowWhat": { "type": "string" }
                    }
                  },
                  "key_stats": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": { "type": "string" },
                        "value": { "type": "string" },
                        "note": { "type": "string" }
                      }
                    }
                  },
                  "paragraphs": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "references": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": { "type": "string" },
                        "desc": { "type": "string" }
                      }
                    }
                  },
                  "social_cards": {
                    "type": "object",
                    "properties": {
                      "feedHeadline": { "type": "string", "description": "Judul kartu grafis 4 elemen: Lokasi + Data + Peristiwa + Dramatisasi" },
                      "storyHeadline": { "type": "string" }
                    }
                  },
                  "instagram_caption": { "type": "string" },
                  "steps_data": { "type": "object", "description": "Hasil audit ke-14 tahapan redaksi" }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Draf berhasil dibuat",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "id": { "type": "string" },
                    "draftUrl": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
