{"openapi":"3.1.0","info":{"title":"Copubli API","version":"1.0.0","description":"# Copubli API\n\nAPI für hyperlokale Nachrichten in der Schweiz.\n\n## Übersicht\n\nCopubli ist eine Community-basierte Newsplattform für hyperlokale Nachrichten. Diese API ermöglicht den Zugriff auf:\n\n- **Artikel** - Lokalnachrichten, Medienmitteilungen, Autorenberichte\n- **Events** - Veranstaltungen und Termine\n- **Regionen** - Hierarchische Regionsstruktur (Grossregion → Kanton → Wahlkreis → Gemeinde)\n- **Organisationen** - Vereine, Parteien, Firmen\n- **Autoren** - Profile und Artikel von Autoren\n- **Kommentare** - Diskussionen und Gemeinschaftsnotizen\n\n## Authentifizierung\n\nÖffentliche Endpunkte benötigen keine Authentifizierung.\n\nFür Schreibzugriffe (eigene Agents, Server-zu-Server) wird ein **API-Key** benötigt:\n\n- Erstellung im Dashboard unter *Einstellungen → API-Keys* (Format `cpb_...`)\n- Übergabe als `Authorization: Bearer cpb_...` oder `X-API-Key: cpb_...`\n- Berechtigungen über Scopes: `articles:read`, `articles:write`, `media:write`, `events:write`\n\nTypischer Agent-Flow: `POST /api/v1/media/upload` (Bilder) → `POST /api/v1/articles/create` (Artikel, empfohlen mit `status: \"DRAFT\"`) → `GET /api/v1/articles/by-id/{id}` (Status).\n\nBrowser-Sessions (Login) verwenden Cookie-basierte Authentifizierung (Better Auth).\n\n## Rate Limiting\n\n- Öffentlich: 100 Anfragen pro Minute\n- Authentifiziert: 1000 Anfragen pro Minute\n\n## Regionen\n\nSchweizer Regionen sind hierarchisch organisiert:\n1. Grossregion (z.B. Ostschweiz)\n2. Kanton (z.B. St. Gallen)\n3. Wahlkreis (z.B. Toggenburg)\n4. Gemeinde (z.B. Wattwil)\n\n## Monetarisierung\n\nAutoren verdienen an den Werbeeinnahmen ihrer Artikel:\n- Bis zu 25% Autor\n- Rest: Plattform, Gemeinschaftsnotizen, Reserve","contact":{"name":"Copubli Support","email":"api@copubli.com","url":"https://copubli.com/kontakt"},"license":{"name":"Proprietary","url":"https://copubli.com/api-terms"}},"servers":[{"url":"https://api.copubli.com","description":"Production"},{"url":"http://localhost:8788","description":"Development"}],"tags":[{"name":"Articles","description":"Artikel und Nachrichten"},{"name":"Events","description":"Veranstaltungen und Termine"},{"name":"Regions","description":"Regionen und Gemeinden"},{"name":"Organizations","description":"Organisationen, Vereine, Parteien"},{"name":"Users","description":"Benutzer-Management"},{"name":"Authors","description":"Autoren und deren Profile"},{"name":"Subscriptions","description":"Abonnements (Regionen, Autoren, Tags)"},{"name":"Comments","description":"Kommentare und Diskussionen"},{"name":"Community Notes","description":"Gemeinschaftsnotizen (Kontext & Korrekturen)"},{"name":"Monetization","description":"Verdienst und Auszahlungen"},{"name":"Payouts","description":"Auszahlungs-Historie und Einstellungen"},{"name":"Search","description":"Volltextsuche"},{"name":"Auth","description":"Authentifizierung"},{"name":"Admin","description":"Admin-Funktionen"},{"name":"WhatsApp","description":"WhatsApp-Integration für Artikel-Einreichungen"},{"name":"Podcast","description":"Podcast-Interviews via Sprachnachrichten"}],"components":{"schemas":{"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"name":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"bannerImage":{"type":"string","nullable":true},"role":{"type":"string","enum":["READER","AUTHOR","REGION_ADMIN","ADMIN"]},"isAuthor":{"type":"boolean"},"authorSlug":{"type":"string","nullable":true},"authorBio":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"regionSlug":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"instagram":{"type":"string","nullable":true},"facebook":{"type":"string","nullable":true},"linkedin":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true},"notifyEmail":{"type":"boolean"},"notifyWhatsApp":{"type":"boolean"},"notifyDailyDigest":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","email","name","image","bannerImage","role","isAuthor","authorSlug","authorBio","location","regionSlug","website","instagram","facebook","linkedin","twitter","notifyEmail","notifyWhatsApp","notifyDailyDigest","createdAt"]},"AuthorPublic":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"bio":{"type":"string","nullable":true},"articleCount":{"type":"number"},"totalViews":{"type":"number"}},"required":["id","name","slug","bio","articleCount","totalViews"]},"AuthorApplication":{"type":"object","properties":{"name":{"type":"string","minLength":2},"slug":{"type":"string","minLength":3,"pattern":"^[a-z0-9-]+$"},"bio":{"type":"string","maxLength":500},"motivation":{"type":"string","minLength":50},"sampleTopics":{"type":"array","items":{"type":"string"},"minItems":1},"region":{"type":"string"}},"required":["name","slug","motivation","sampleTopics","region"]},"PayoutSettings":{"type":"object","properties":{"iban":{"type":"string","pattern":"^CH[0-9]{2}[0-9A-Z]{4}[0-9]{7}[0-9A-Z]{8}$|^CH[0-9]{19}$"}},"required":["iban"]},"Subscription":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["region","organization","author","tag","dossier"]},"targetId":{"type":"string"},"targetName":{"type":"string"},"targetSlug":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","type","targetId","targetName","targetSlug","createdAt"]},"CreateSubscription":{"type":"object","properties":{"type":{"type":"string","enum":["region","organization","author","tag","dossier"]},"targetId":{"type":"string"}},"required":["type","targetId"]},"FeedItem":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["article","event"]},"title":{"type":"string"},"lead":{"type":"string","nullable":true},"slug":{"type":"string"},"regionSlug":{"type":"string"},"category":{"type":"string"},"publishedAt":{"type":"string"},"source":{"type":"object","properties":{"type":{"type":"string","enum":["region","organization","author","tag","dossier"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]}},"required":["id","type","title","lead","slug","regionSlug","category","publishedAt","source"]},"CommentAuthor":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isAuthor":{"type":"boolean"}},"required":["id","name","isAuthor"]},"CommentOrganization":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"logoUrl":{"type":"string","nullable":true}},"required":["id","name","slug","logoUrl"]},"Comment":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"author":{"$ref":"#/components/schemas/CommentAuthor"},"organization":{"$ref":"#/components/schemas/CommentOrganization"},"parentId":{"type":"string","nullable":true},"likeCount":{"type":"number"},"replyCount":{"type":"number"},"isHidden":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","content","author","parentId","likeCount","replyCount","isHidden","createdAt","updatedAt"]},"CreateComment":{"type":"object","properties":{"articleId":{"type":"string"},"content":{"type":"string","minLength":1,"maxLength":2000},"parentId":{"type":"string"},"organizationId":{"type":"string"}},"required":["articleId","content"]},"CommunityNote":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"sources":{"type":"string","nullable":true},"author":{"$ref":"#/components/schemas/CommentAuthor"},"helpfulCount":{"type":"number"},"notHelpfulCount":{"type":"number"},"isShown":{"type":"boolean"},"status":{"type":"string","enum":["PENDING","VISIBLE","HIDDEN","DELETED"]},"createdAt":{"type":"string"}},"required":["id","content","sources","author","helpfulCount","notHelpfulCount","isShown","status","createdAt"]},"CreateCommunityNote":{"type":"object","properties":{"articleId":{"type":"string"},"content":{"type":"string","minLength":20,"maxLength":500},"sources":{"type":"string"}},"required":["articleId","content"]},"Payout":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED"]},"reference":{"type":"string","nullable":true},"createdAt":{"type":"string"},"processedAt":{"type":"string","nullable":true}},"required":["id","amount","currency","status","reference","createdAt","processedAt"]},"PayoutHistory":{"type":"object","properties":{"payouts":{"type":"array","items":{"$ref":"#/components/schemas/Payout"}},"total":{"type":"number"},"stats":{"type":"object","properties":{"totalPaid":{"type":"number"},"pendingAmount":{"type":"number"},"nextPayoutDate":{"type":"string","nullable":true}},"required":["totalPaid","pendingAmount","nextPayoutDate"]}},"required":["payouts","total","stats"]},"RevenueBreakdown":{"type":"object","properties":{"articleId":{"type":"string"},"articleTitle":{"type":"string"},"views":{"type":"number"},"grossRevenue":{"type":"number"},"authorShare":{"type":"number"},"period":{"type":"string"}},"required":["articleId","articleTitle","views","grossRevenue","authorShare","period"]},"WhatsAppSubmission":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"text":{"type":"string","nullable":true},"mediaUrls":{"type":"array","items":{"type":"string"}},"voiceUrl":{"type":"string","nullable":true},"voiceDuration":{"type":"number","nullable":true},"status":{"type":"string","enum":["PENDING","PROCESSING","AWAITING_INFO","DRAFT_CREATED","PUBLISHED","REJECTED","FAILED"]},"type":{"type":"string","enum":["ARTICLE","EVENT","TIP","INTERVIEW","FEEDBACK"]},"extractedData":{"nullable":true},"suggestedRegion":{"type":"string","nullable":true},"suggestedCategory":{"type":"string","nullable":true},"articleId":{"type":"string","nullable":true},"receivedAt":{"type":"string"},"processedAt":{"type":"string","nullable":true}},"required":["id","phone","text","mediaUrls","voiceUrl","voiceDuration","status","type","suggestedRegion","suggestedCategory","articleId","receivedAt","processedAt"]},"AdminStats":{"type":"object","properties":{"users":{"type":"object","properties":{"total":{"type":"number"},"readers":{"type":"number"},"authors":{"type":"number"},"admins":{"type":"number"},"newThisMonth":{"type":"number"}},"required":["total","readers","authors","admins","newThisMonth"]},"organizations":{"type":"object","properties":{"total":{"type":"number"},"claimed":{"type":"number"},"pending":{"type":"number"},"unclaimed":{"type":"number"}},"required":["total","claimed","pending","unclaimed"]},"articles":{"type":"object","properties":{"total":{"type":"number"},"published":{"type":"number"},"drafts":{"type":"number"},"thisMonth":{"type":"number"}},"required":["total","published","drafts","thisMonth"]},"events":{"type":"object","properties":{"total":{"type":"number"},"upcoming":{"type":"number"}},"required":["total","upcoming"]}},"required":["users","organizations","articles","events"]},"AdminUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string","nullable":true},"role":{"type":"string","enum":["READER","AUTHOR","REGION_ADMIN","ADMIN"]},"isAuthor":{"type":"boolean"},"phone":{"type":"string","nullable":true},"phoneVerified":{"type":"boolean"},"monetizationStatus":{"type":"string","enum":["NONE","PENDING","APPROVED","REJECTED","SUSPENDED"]},"createdAt":{"type":"string"},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"}},"required":["id","name","role"]}},"_count":{"type":"object","properties":{"articles":{"type":"number"},"comments":{"type":"number"}},"required":["articles","comments"]}},"required":["id","email","name","role","isAuthor","phone","phoneVerified","monetizationStatus","createdAt","organizations","_count"]}},"parameters":{}},"paths":{"/api/v1/articles":{"get":{"tags":["Articles"],"summary":"List articles","description":"Get a paginated list of published articles","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organizationId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"authorId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"since","in":"query"},{"schema":{"type":"string","enum":["recent","relevant","popular","discussed"],"default":"recent"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"List of articles","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string"},"content":{"type":"string","minLength":1},"summary":{"type":"string","nullable":true,"maxLength":500},"type":{"type":"string","enum":["RAW","PROCESSED","AUTHORED"]},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string"},"region":{"type":"string"},"views":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"author":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"notesCount":{"type":"number"}},"required":["id","title","slug","content","summary","type","status","category","region","views","publishedAt","createdAt","author","organization","notesCount"]}},"nextCursor":{"type":"string","nullable":true}},"required":["data","nextCursor"]}}}}}}},"/api/v1/articles/{slug}/similar":{"get":{"tags":["Articles"],"summary":"Get similar articles by slug","parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":12},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Semantically similar published articles","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string"},"content":{"type":"string","minLength":1},"summary":{"type":"string","nullable":true,"maxLength":500},"type":{"type":"string","enum":["RAW","PROCESSED","AUTHORED"]},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string"},"region":{"type":"string"},"views":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"author":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"notesCount":{"type":"number"}},"required":["id","title","slug","content","summary","type","status","category","region","views","publishedAt","createdAt","author","organization","notesCount"]}}},"required":["data"]}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"number"}},"required":["message","status"]}},"required":["error"]}}}}}}},"/api/v1/articles/{slug}":{"get":{"tags":["Articles"],"summary":"Get article by slug","parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Article details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string"},"content":{"type":"string","minLength":1},"summary":{"type":"string","nullable":true,"maxLength":500},"type":{"type":"string","enum":["RAW","PROCESSED","AUTHORED"]},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string"},"region":{"type":"string"},"views":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"author":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"notesCount":{"type":"number"},"lead":{"type":"string","nullable":true},"blocks":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"content":{"type":"string"}},"required":["type","content"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"src":{"type":"string"},"alt":{"type":"string"},"caption":{"type":"string"},"credit":{"type":"string"}},"required":["type","src"]},{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"src":{"type":"string"},"provider":{"type":"string","enum":["youtube","vimeo","native"]},"caption":{"type":"string"}},"required":["type","src"]},{"type":"object","properties":{"type":{"type":"string","enum":["gallery"]},"images":{"type":"array","items":{"type":"object","properties":{"src":{"type":"string"},"alt":{"type":"string"},"caption":{"type":"string"},"credit":{"type":"string"}},"required":["src"]}}},"required":["type","images"]},{"type":"object","properties":{"type":{"type":"string","enum":["quote"]},"text":{"type":"string"},"author":{"type":"string"},"source":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["infobox"]},"title":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}}},"required":["type","title","items"]},{"type":"object","properties":{"type":{"type":"string","enum":["heading"]},"content":{"type":"string"},"level":{"type":"number"}},"required":["type","content"]},{"type":"object","properties":{"type":{"type":"string","enum":["divider"]},"content":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["list"]},"content":{"type":"string"}},"required":["type","content"]}]}},"layout":{"type":"string"}},"required":["id","title","slug","content","summary","type","status","category","region","views","publishedAt","createdAt","author","organization","notesCount","lead","blocks","layout"]}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"number"}},"required":["message","status"]}},"required":["error"]}}}}}}},"/api/v1/articles/region/{regionSlug}":{"get":{"tags":["Articles"],"summary":"Get articles by region","parameters":[{"schema":{"type":"string"},"required":true,"name":"regionSlug","in":"path"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"List of articles in region","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string"},"content":{"type":"string","minLength":1},"summary":{"type":"string","nullable":true,"maxLength":500},"type":{"type":"string","enum":["RAW","PROCESSED","AUTHORED"]},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string"},"region":{"type":"string"},"views":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"author":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"notesCount":{"type":"number"}},"required":["id","title","slug","content","summary","type","status","category","region","views","publishedAt","createdAt","author","organization","notesCount"]}},"nextCursor":{"type":"string","nullable":true}},"required":["data","nextCursor"]}}}}}}},"/api/v1/articles/create":{"post":{"tags":["Articles"],"summary":"Create article","description":"Create a new article (requires authentication as AUTHOR or ADMIN)","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":5},"slug":{"type":"string","minLength":3,"pattern":"^[a-z0-9-]+$"},"lead":{"type":"string","maxLength":500},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["text","heading","image","video","quote","infobox","list","gallery","divider"]},"content":{"type":"string"},"meta":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","type","content"]}},"regionSlug":{"type":"string"},"additionalRegions":{"type":"array","items":{"type":"string"}},"category":{"type":"string"},"additionalCategories":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["DRAFT","PENDING","PUBLISHED"],"default":"DRAFT"},"format":{"type":"string","enum":["STANDARD","GALLERY","VIDEO","AUDIO","LINK"],"default":"STANDARD"},"commentsEnabled":{"type":"boolean","default":true},"authorName":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"featuredImageUrl":{"type":"string","nullable":true},"featuredImageAlt":{"type":"string","nullable":true},"featuredImageCredit":{"type":"string","nullable":true},"featuredImageSourcePageUrl":{"type":"string","nullable":true}},"required":["title","slug","blocks","regionSlug","category"]}}}},"responses":{"201":{"description":"Article created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}},"required":["id","slug","status","message"]}}}},"400":{"description":"Invalid input"},"401":{"description":"Not authenticated"},"403":{"description":"Not authorized (not an author)"},"409":{"description":"Slug already exists"}}}},"/api/v1/articles/by-id/{id}":{"get":{"tags":["Articles"],"summary":"Get article by ID","description":"Get article details by ID for editing","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Article details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string"},"content":{"type":"string","minLength":1},"summary":{"type":"string","nullable":true,"maxLength":500},"type":{"type":"string","enum":["RAW","PROCESSED","AUTHORED"]},"status":{"type":"string","enum":["DRAFT","PUBLISHED","ARCHIVED"]},"category":{"type":"string"},"region":{"type":"string"},"views":{"type":"number"},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"author":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"notesCount":{"type":"number"}},"required":["id","title","slug","content","summary","type","status","category","region","views","publishedAt","createdAt","author","organization","notesCount"]}}}},"404":{"description":"Article not found"}}}},"/api/v1/articles/{id}":{"put":{"tags":["Articles"],"summary":"Update article","description":"Update an existing article (requires ownership or admin)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":5},"slug":{"type":"string","minLength":3,"pattern":"^[a-z0-9-]+$"},"lead":{"type":"string","maxLength":500},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["text","heading","image","video","quote","infobox","list","gallery","divider"]},"content":{"type":"string"},"meta":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","type","content"]}},"regionSlug":{"type":"string"},"additionalRegions":{"type":"array","items":{"type":"string"}},"category":{"type":"string"},"additionalCategories":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["DRAFT","PENDING","PUBLISHED"],"default":"DRAFT"},"format":{"type":"string","enum":["STANDARD","GALLERY","VIDEO","AUDIO","LINK"],"default":"STANDARD"},"commentsEnabled":{"type":"boolean","default":true},"authorName":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"featuredImageUrl":{"type":"string","nullable":true},"featuredImageAlt":{"type":"string","nullable":true},"featuredImageCredit":{"type":"string","nullable":true},"featuredImageSourcePageUrl":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Article updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}},"required":["id","slug","status","message"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Not authorized"},"404":{"description":"Article not found"}}},"delete":{"tags":["Articles"],"summary":"Delete article (soft delete)","description":"Marks article as deleted. Only the author or admin can delete.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Article deleted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Not authorized"},"404":{"description":"Article not found"}}}},"/api/v1/articles/{id}/co-authors":{"put":{"tags":["Articles"],"summary":"Manage co-authors","description":"Add or remove co-authors (only main author or admin can do this)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["add","remove","set"]},"userIds":{"type":"array","items":{"type":"string"}}},"required":["action","userIds"]}}}},"responses":{"200":{"description":"Co-authors updated","content":{"application/json":{"schema":{"type":"object","properties":{"coAuthorIds":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["coAuthorIds","message"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Only main author can manage co-authors"},"404":{"description":"Article not found"}}}},"/api/v1/articles/{id}/restore":{"post":{"tags":["Articles"],"summary":"Restore deleted article","description":"Restores a soft-deleted article. Admin only.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Article restored","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Admin only"},"404":{"description":"Article not found"}}}},"/api/v1/events/{id}":{"get":{"tags":["Events"],"summary":"Get event by ID","description":"Get a single event. Use format=schema for JSON-LD output.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["json","schema","ical"],"default":"json"},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"Event details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","nullable":true,"format":"date-time"},"allDay":{"type":"boolean"},"location":{"type":"string","nullable":true},"category":{"type":"string"},"region":{"type":"string"},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]}},"required":["id","title","description","startDate","endDate","allDay","location","category","region","organization"]}}}},"404":{"description":"Event not found"}}},"put":{"tags":["Events"],"summary":"Update event","description":"Update an existing event (requires ownership or admin)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":3},"description":{"type":"string"},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","format":"date-time"},"allDay":{"type":"boolean","default":false},"location":{"type":"string"},"category":{"type":"string"},"regionSlug":{"type":"string"},"organizationId":{"type":"string"},"commentsEnabled":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Event updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"}},"required":["id","title","message"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Not authorized"},"404":{"description":"Event not found"}}},"delete":{"tags":["Events"],"summary":"Delete event","description":"Delete an event (requires ownership or admin)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Event deleted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Not authorized"},"404":{"description":"Event not found"}}}},"/api/v1/events":{"get":{"tags":["Events"],"summary":"List events","description":"Get a paginated list of upcoming events","parameters":[{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organizationId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","nullable":true,"format":"date-time"},"allDay":{"type":"boolean"},"location":{"type":"string","nullable":true},"category":{"type":"string"},"region":{"type":"string"},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]}},"required":["id","title","description","startDate","endDate","allDay","location","category","region","organization"]}},"nextCursor":{"type":"string","nullable":true}},"required":["data","nextCursor"]}}}}}}},"/api/v1/events/by-date":{"get":{"tags":["Events"],"summary":"Events grouped by date","description":"Get events grouped by date for calendar display","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}$"},"required":true,"name":"year","in":"query"},{"schema":{"type":"string","pattern":"^(0?[1-9]|1[0-2])$"},"required":true,"name":"month","in":"query"},{"schema":{"type":"string"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"}],"responses":{"200":{"description":"Events by date","content":{"application/json":{"schema":{"type":"object","properties":{"year":{"type":"number"},"month":{"type":"number"},"events":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","nullable":true,"format":"date-time"},"allDay":{"type":"boolean"},"location":{"type":"string","nullable":true},"category":{"type":"string"},"region":{"type":"string"},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]}},"required":["id","title","description","startDate","endDate","allDay","location","category","region","organization"]}}},"totalCount":{"type":"number"}},"required":["year","month","events","totalCount"]}}}}}}},"/api/v1/events/my-events":{"post":{"tags":["Events","Subscriptions"],"summary":"Events based on subscriptions","description":"Get events from subscribed regions and organizations","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"regionIds":{"type":"array","items":{"type":"string"}},"organizationIds":{"type":"array","items":{"type":"string"}},"limit":{"type":"number","default":50}}}}}},"responses":{"200":{"description":"Personalized events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","nullable":true,"format":"date-time"},"allDay":{"type":"boolean"},"location":{"type":"string","nullable":true},"category":{"type":"string"},"region":{"type":"string"},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]}},"required":["id","title","description","startDate","endDate","allDay","location","category","region","organization"]}},"count":{"type":"number"}},"required":["data","count"]}}}}}}},"/api/v1/events/ical":{"get":{"tags":["Events"],"summary":"iCal feed","description":"Get events as iCal feed for calendar apps. Supports multiple regions via comma-separated list.","parameters":[{"schema":{"type":"string","description":"Single region slug (legacy)"},"required":false,"description":"Single region slug (legacy)","name":"region","in":"query"},{"schema":{"type":"string","description":"Comma-separated list of region slugs"},"required":false,"description":"Comma-separated list of region slugs","name":"regions","in":"query"},{"schema":{"type":"string","description":"Event category filter"},"required":false,"description":"Event category filter","name":"category","in":"query"}],"responses":{"200":{"description":"iCal feed","content":{"text/calendar":{"schema":{"type":"string"}}}}}}},"/api/v1/events/create":{"post":{"tags":["Events"],"summary":"Create event","description":"Create a new event (requires authentication)","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":3},"description":{"type":"string"},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","format":"date-time"},"allDay":{"type":"boolean","default":false},"location":{"type":"string"},"category":{"type":"string"},"regionSlug":{"type":"string"},"organizationId":{"type":"string"},"commentsEnabled":{"type":"boolean","default":true}},"required":["title","startDate","category","regionSlug"]}}}},"responses":{"201":{"description":"Event created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"}},"required":["id","title","message"]}}}},"400":{"description":"Invalid input"},"401":{"description":"Not authenticated"}}}},"/api/v1/events/me/events":{"get":{"tags":["Events"],"summary":"My events","description":"Get events created by the authenticated user","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"includesPast","in":"query"}],"responses":{"200":{"description":"List of user events","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","nullable":true,"format":"date-time"},"allDay":{"type":"boolean"},"location":{"type":"string","nullable":true},"category":{"type":"string"},"region":{"type":"string"},"organization":{"type":"object","nullable":true,"properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","startDate","endDate","allDay","location","category","region","organization","createdAt","updatedAt"]}},"total":{"type":"number"}},"required":["events","total"]}}}}}}},"/api/v1/events/{id}/co-editors":{"put":{"tags":["Events"],"summary":"Manage co-editors","description":"Add or remove co-editors (only creator or admin can do this)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["add","remove","set"]},"userIds":{"type":"array","items":{"type":"string"}}},"required":["action","userIds"]}}}},"responses":{"200":{"description":"Co-editors updated","content":{"application/json":{"schema":{"type":"object","properties":{"coEditorIds":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}},"required":["coEditorIds","message"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Only creator can manage co-editors"},"404":{"description":"Event not found"}}}},"/api/v1/events/{id}/comments":{"get":{"tags":["Events","Comments"],"summary":"Kommentare zu einem Event","description":"Gibt alle Kommentare zu einem Event zurück","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["newest","oldest","popular"],"default":"newest"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Kommentare","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isAuthor":{"type":"boolean"}},"required":["id","name","isAuthor"]},"parentId":{"type":"string","nullable":true},"likeCount":{"type":"number"},"replyCount":{"type":"number"},"isHidden":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","content","author","parentId","likeCount","replyCount","isHidden","createdAt","updatedAt"]}},"total":{"type":"number"}},"required":["comments","total"]}}}},"404":{"description":"Event not found"}}},"post":{"tags":["Events","Comments"],"summary":"Kommentar zu Event erstellen","description":"Erstellt einen neuen Kommentar zu einem Event","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":2000},"parentId":{"type":"string"}},"required":["content"]}}}},"responses":{"201":{"description":"Kommentar erstellt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"comment":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isAuthor":{"type":"boolean"}},"required":["id","name","isAuthor"]},"parentId":{"type":"string","nullable":true},"likeCount":{"type":"number"},"replyCount":{"type":"number"},"isHidden":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","content","author","parentId","likeCount","replyCount","isHidden","createdAt","updatedAt"]}},"required":["success","comment"]}}}},"401":{"description":"Not authenticated"},"404":{"description":"Event not found"}}}},"/api/v1/organizations/my":{"get":{"tags":["Organizations"],"summary":"Get my organizations","description":"Get all organizations the current user is a member of","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of user organizations","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"logo":{"type":"string","nullable":true},"status":{"type":"string"},"role":{"type":"string"},"memberCount":{"type":"number"},"articleCount":{"type":"number"},"eventCount":{"type":"number"}},"required":["id","name","slug","type","logo","status","role","memberCount","articleCount","eventCount"]}}},"required":["organizations"]}}}},"401":{"description":"Not authenticated"}}}},"/api/v1/organizations/{id}":{"get":{"tags":["Organizations"],"summary":"Get organization details","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Organization details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"logo":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"status":{"type":"string"},"memberCount":{"type":"number"}},"required":["id","name","slug","description","type","logo","website","email","phone","address","status","memberCount"]}}}},"404":{"description":"Organization not found"}}},"put":{"tags":["Organizations"],"summary":"Update organization","description":"Update organization details (admin/owner only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2},"description":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"logo":{"type":"string","nullable":true},"bannerImage":{"type":"string","nullable":true},"instagram":{"type":"string","nullable":true},"facebook":{"type":"string","nullable":true},"linkedin":{"type":"string","nullable":true},"twitter":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Organization updated"},"401":{"description":"Not authenticated"},"403":{"description":"Not authorized"},"404":{"description":"Organization not found"}}}},"/api/v1/organizations/by-slug/{slug}":{"get":{"tags":["Organizations"],"summary":"Get organization by slug (public)","parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Organization details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"logo":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"status":{"type":"string"},"memberCount":{"type":"number"}},"required":["id","name","slug","description","type","logo","website","email","phone","address","status","memberCount"]}}}},"404":{"description":"Organization not found"}}}},"/api/v1/organizations":{"post":{"tags":["Organizations"],"summary":"Create organization","description":"Create a new organization (user becomes owner)","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2},"slug":{"type":"string","minLength":2,"pattern":"^[a-z0-9-]+$"},"description":{"type":"string"},"type":{"type":"string","enum":["VEREIN","FIRMA","BEHOERDE","PARTEI","KIRCHE","SCHULE","ANDERE"]},"website":{"type":"string","format":"uri"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"address":{"type":"string"},"region":{"type":"string","minLength":1}},"required":["name","slug","type","region"]}}}},"responses":{"201":{"description":"Organization created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"message":{"type":"string"}},"required":["id","slug","message"]}}}},"400":{"description":"Invalid input or slug taken"},"401":{"description":"Not authenticated"}}}},"/api/v1/organizations/{id}/members":{"get":{"tags":["Organizations"],"summary":"List organization members","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"List of members","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string"},"role":{"type":"string"},"joinedAt":{"type":"string"}},"required":["id","userId","name","email","role","joinedAt"]}}},"required":["members"]}}}}}},"post":{"tags":["Organizations"],"summary":"Add member to organization","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","EDITOR","AD_MANAGER","MEMBER"],"default":"MEMBER"}},"required":["userId"]}}}},"responses":{"201":{"description":"Member added"},"400":{"description":"User already member"},"403":{"description":"Not authorized"}}}},"/api/v1/organizations/{id}/members/{userId}":{"delete":{"tags":["Organizations"],"summary":"Remove member from organization","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"Member removed"},"403":{"description":"Not authorized"},"404":{"description":"Member not found"}}}},"/api/v1/organizations/{id}/members/{userId}/role":{"put":{"tags":["Organizations"],"summary":"Change member role","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","EDITOR","AD_MANAGER","MEMBER"]}},"required":["role"]}}}},"responses":{"200":{"description":"Role updated"},"403":{"description":"Not authorized"}}}},"/api/v1/organizations/{id}/members/invite":{"post":{"tags":["Organizations"],"summary":"Invite member by email","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["OWNER","ADMIN","EDITOR","AD_MANAGER","MEMBER"],"default":"MEMBER"}},"required":["email"]}}}},"responses":{"201":{"description":"Invitation sent"},"400":{"description":"Invalid input or already member"},"403":{"description":"Not authorized"}}}},"/api/v1/organizations/invites/{token}/accept":{"post":{"tags":["Organizations"],"summary":"Accept organization invite","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"Invite accepted"},"400":{"description":"Invalid or expired invite"},"401":{"description":"Not authenticated"}}}},"/api/v1/organizations/invites/{token}":{"get":{"tags":["Organizations"],"summary":"Get invite details","parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"Invite details","content":{"application/json":{"schema":{"type":"object","properties":{"organizationName":{"type":"string"},"role":{"type":"string"},"email":{"type":"string"},"inviterName":{"type":"string"},"expiresAt":{"type":"string"}},"required":["organizationName","role","email","inviterName","expiresAt"]}}}},"404":{"description":"Invite not found"},"410":{"description":"Invite expired"}}}},"/api/v1/organizations/{id}/claim":{"post":{"tags":["Organizations"],"summary":"Organisation beanspruchen","description":"Beansprucht eine nicht beanspruchte Organisation. Erfordert Verifizierung via E-Mail-Domain oder manuell.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","minLength":2},"message":{"type":"string","maxLength":500}},"required":["email","role"]}}}},"responses":{"200":{"description":"Claiming-Anfrage eingereicht","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status":{"type":"string","enum":["pending","verified","rejected"]},"message":{"type":"string"},"verificationMethod":{"type":"string","enum":["email","manual"]}},"required":["success","status","message"]}}}},"400":{"description":"Organisation bereits beansprucht oder ungültige Anfrage"},"401":{"description":"Nicht authentifiziert"},"404":{"description":"Organisation nicht gefunden"}}}},"/api/v1/organizations/{id}/report-duplicate":{"post":{"tags":["Organizations"],"summary":"Duplikat melden","description":"Meldet eine Organisation als Duplikat einer anderen","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"duplicateOfId":{"type":"string"},"duplicateOfName":{"type":"string"},"reason":{"type":"string","minLength":10}},"required":["reason"]}}}},"responses":{"200":{"description":"Duplikat-Meldung eingereicht","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"reportId":{"type":"string"}},"required":["success","message","reportId"]}}}},"401":{"description":"Nicht authentifiziert"},"404":{"description":"Organisation nicht gefunden"}}}},"/api/v1/organizations/search":{"get":{"tags":["Organizations"],"summary":"Organisationen suchen","description":"Durchsucht Organisationen nach Name (für Autocomplete)","parameters":[{"schema":{"type":"string","minLength":2},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"region","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":20,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Suchergebnisse","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"string"}},"region":{"type":"string"},"status":{"type":"string"}},"required":["id","name","slug","description","categories","region","status"]}}},"required":["organizations"]}}}}}}},"/api/v1/organizations/{id}/monetization":{"get":{"tags":["Organizations"],"summary":"Monetarisierungsstatus abrufen","description":"Zeigt den Monetarisierungsstatus einer Organisation (nur für Admins/Owner)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Monetarisierungsstatus","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["NONE","PENDING","APPROVED","REJECTED","SUSPENDED"]},"appliedAt":{"type":"string","nullable":true},"approvedAt":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"iban":{"type":"string","nullable":true},"ibanVerified":{"type":"boolean"},"totalEarnings":{"type":"number"}},"required":["status","appliedAt","approvedAt","note","iban","ibanVerified","totalEarnings"]}}}},"401":{"description":"Nicht angemeldet"},"403":{"description":"Keine Berechtigung"},"404":{"description":"Organisation nicht gefunden"}}}},"/api/v1/organizations/{id}/monetization/apply":{"post":{"tags":["Organizations"],"summary":"Monetarisierung beantragen","description":"Beantragt Monetarisierung für eine Organisation (nur Owner)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"iban":{"type":"string","description":"Schweizer IBAN (CH...)"}},"required":["iban"]}}}},"responses":{"200":{"description":"Antrag eingereicht","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"status":{"type":"string"}},"required":["success","message","status"]}}}},"400":{"description":"Ungültige IBAN oder bereits beantragt"},"401":{"description":"Nicht angemeldet"},"403":{"description":"Nur Owner können Monetarisierung beantragen"},"404":{"description":"Organisation nicht gefunden"}}}},"/api/v1/organizations/{id}/articles":{"get":{"tags":["Organizations"],"summary":"Get organization articles","description":"Get all articles published by this organization (members only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Organization articles","content":{"application/json":{"schema":{"type":"object","properties":{"articles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"region":{"type":"string"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"views":{"type":"number"},"commentsCount":{"type":"number"}},"required":["id","title","slug","status","region","publishedAt","createdAt","updatedAt","views","commentsCount"]}},"stats":{"type":"object","properties":{"published":{"type":"number"},"drafts":{"type":"number"},"pending":{"type":"number"},"totalViews":{"type":"number"}},"required":["published","drafts","pending","totalViews"]}},"required":["articles","stats"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Not a member"},"404":{"description":"Organization not found"}}}},"/api/v1/organizations/{id}/stats":{"get":{"tags":["Organizations"],"summary":"Get organization stats","description":"Get statistics for an organization (members only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Organization statistics","content":{"application/json":{"schema":{"type":"object","properties":{"artikelCount":{"type":"number"},"viewsTotal":{"type":"number"},"kommentareCount":{"type":"number"},"memberCount":{"type":"number"},"eventCount":{"type":"number"}},"required":["artikelCount","viewsTotal","kommentareCount","memberCount","eventCount"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Not a member"}}}},"/api/v1/organizations/{id}/events":{"get":{"tags":["Organizations"],"summary":"Get organization events","description":"Get all events by this organization (members only)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"includesPast","in":"query"}],"responses":{"200":{"description":"Organization events","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"startDate":{"type":"string"},"endDate":{"type":"string","nullable":true},"allDay":{"type":"boolean"},"location":{"type":"string","nullable":true},"category":{"type":"string"},"region":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","title","description","startDate","endDate","allDay","location","category","region","createdAt"]}},"total":{"type":"number"}},"required":["events","total"]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Not a member"}}}},"/api/v1/regions":{"get":{"tags":["Regions"],"summary":"List all regions","description":"Get list of regions, optionally filtered by level or parent","parameters":[{"schema":{"type":"number","nullable":true,"minimum":0,"maximum":4},"required":false,"name":"level","in":"query"},{"schema":{"type":"string"},"required":false,"name":"parentId","in":"query"}],"responses":{"200":{"description":"List of regions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"level":{"type":"number","minimum":0,"maximum":4},"description":{"type":"string","nullable":true},"parentId":{"type":"string","nullable":true},"centerLat":{"type":"number","nullable":true},"centerLng":{"type":"number","nullable":true},"population":{"type":"number","nullable":true}},"required":["id","name","slug","level","description","parentId","centerLat","centerLng","population"]}}},"required":["data"]}}}}}}},"/api/v1/regions/expand-slugs":{"get":{"tags":["Regions"],"summary":"Expand region slugs hierarchically","description":"Returns all slugs in the subtrees of the given root regions (inclusive)","parameters":[{"schema":{"type":"string","description":"Comma-separated region slugs"},"required":true,"name":"slugs","in":"query"}],"responses":{"200":{"description":"Expanded slug list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}}}}},"/api/v1/regions/{slug}":{"get":{"tags":["Regions"],"summary":"Get region by slug","description":"Get region details with children, parent, and breadcrumb path","parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Region details","content":{"application/json":{"schema":{"type":"object","properties":{"region":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"level":{"type":"number","minimum":0,"maximum":4},"description":{"type":"string","nullable":true},"parentId":{"type":"string","nullable":true},"centerLat":{"type":"number","nullable":true},"centerLng":{"type":"number","nullable":true},"population":{"type":"number","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"level":{"type":"number","minimum":0,"maximum":4},"description":{"type":"string","nullable":true},"parentId":{"type":"string","nullable":true},"centerLat":{"type":"number","nullable":true},"centerLng":{"type":"number","nullable":true},"population":{"type":"number","nullable":true}},"required":["id","name","slug","level","description","parentId","centerLat","centerLng","population"]}},"parent":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"level":{"type":"number","minimum":0,"maximum":4},"description":{"type":"string","nullable":true},"parentId":{"type":"string","nullable":true},"centerLat":{"type":"number","nullable":true},"centerLng":{"type":"number","nullable":true},"population":{"type":"number","nullable":true}},"required":["id","name","slug","level","description","parentId","centerLat","centerLng","population"]},"articleCount":{"type":"number"},"eventCount":{"type":"number"}},"required":["id","name","slug","level","description","parentId","centerLat","centerLng","population","children","parent"]},"breadcrumbs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"level":{"type":"number"}},"required":["id","name","slug","level"]}}},"required":["region","breadcrumbs"]}}}},"404":{"description":"Region not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"number"}},"required":["message","status"]}},"required":["error"]}}}}}}},"/api/v1/regions/tree":{"get":{"tags":["Regions"],"summary":"Get region tree","description":"Get full nested region hierarchy starting from Grossregionen","responses":{"200":{"description":"Region tree","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"nullable":true}}},"required":["data"]}}}}}}},"/api/v1/search":{"get":{"tags":["Search"],"summary":"Volltextsuche","description":"Durchsucht Artikel, Events und Organisationen mit Meilisearch","parameters":[{"schema":{"type":"string","minLength":1,"description":"Suchbegriff"},"required":true,"description":"Suchbegriff","name":"q","in":"query"},{"schema":{"type":"string","enum":["all","articles","events","organizations"],"default":"all"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","description":"Filter nach Region-Slug"},"required":false,"description":"Filter nach Region-Slug","name":"region","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":50,"default":10},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Suchergebnisse","content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"results":{"type":"object","properties":{"articles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"lead":{"type":"string","nullable":true},"category":{"type":"string"},"regionSlug":{"type":"string"},"regionName":{"type":"string"},"authorName":{"type":"string","nullable":true},"publishedAt":{"type":"number"},"type":{"type":"string","enum":["article"]}},"required":["id","title","slug","lead","category","regionSlug","regionName","authorName","publishedAt","type"]}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"category":{"type":"string"},"regionSlug":{"type":"string"},"startDate":{"type":"number"},"organizationName":{"type":"string","nullable":true},"type":{"type":"string","enum":["event"]}},"required":["id","title","description","location","category","regionSlug","startDate","organizationName","type"]}},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"string"}},"regionSlug":{"type":"string"},"type":{"type":"string","enum":["organization"]}},"required":["id","name","slug","description","categories","regionSlug","type"]}}},"required":["articles","events","organizations"]},"totalResults":{"type":"number"}},"required":["query","results","totalResults"]}}}},"503":{"description":"Suche nicht verfügbar"}}}},"/api/v1/search/autocomplete":{"get":{"tags":["Search"],"summary":"Autocomplete-Vorschläge","description":"Schnelle Vorschläge während der Eingabe","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"q","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":10,"default":5},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Autocomplete-Ergebnisse","content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"type":{"type":"string","enum":["article","event","organization"]},"url":{"type":"string"}},"required":["text","type","url"]}}},"required":["suggestions"]}}}}}}},"/api/v1/search/reindex":{"post":{"tags":["Search","Admin"],"summary":"Such-Index neu aufbauen","description":"Indiziert alle Inhalte in Meilisearch neu (nur Admins)","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["all","articles","events","organizations"],"default":"all"}}}}}},"responses":{"200":{"description":"Indizierung gestartet","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"indexed":{"type":"object","properties":{"articles":{"type":"number"},"events":{"type":"number"},"organizations":{"type":"number"}}}},"required":["success","indexed"]}}}},"401":{"description":"Nicht authentifiziert"},"403":{"description":"Keine Berechtigung"}}}},"/api/v1/search/health":{"get":{"tags":["Search"],"summary":"Such-Service Status","responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"type":"object","properties":{"healthy":{"type":"boolean"},"fallbackAvailable":{"type":"boolean"}},"required":["healthy","fallbackAvailable"]}}}}}}},"/api/v1/users/me":{"get":{"tags":["Users"],"summary":"Aktuellen Benutzer abrufen","description":"Gibt die Daten des eingeloggten Benutzers zurück","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Benutzerdaten","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Nicht authentifiziert"}}},"put":{"tags":["Users"],"summary":"Profil aktualisieren","description":"Aktualisiert die Profildaten des eingeloggten Benutzers","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2},"image":{"type":"string","nullable":true},"bannerImage":{"type":"string","nullable":true},"authorSlug":{"type":"string","nullable":true,"minLength":3,"pattern":"^[a-z0-9-]+$"},"authorBio":{"type":"string","maxLength":500},"location":{"type":"string"},"regionSlug":{"type":"string","nullable":true},"website":{"type":"string"},"instagram":{"type":"string"},"facebook":{"type":"string"},"linkedin":{"type":"string"},"twitter":{"type":"string"},"notifyEmail":{"type":"boolean"},"notifyWhatsApp":{"type":"boolean"},"notifyDailyDigest":{"type":"boolean"},"acceptAuthorTerms":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Profil aktualisiert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"user":{"$ref":"#/components/schemas/User"}},"required":["success","user"]}}}},"401":{"description":"Nicht authentifiziert"}}}},"/api/v1/users/authors":{"get":{"tags":["Users","Authors"],"summary":"Alle Autoren auflisten","description":"Gibt eine Liste aller aktiven Autoren zurück","parameters":[{"schema":{"type":"string","description":"Nach Region filtern"},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","default":"20","description":"Anzahl Ergebnisse"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0","description":"Offset für Pagination"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Liste der Autoren","content":{"application/json":{"schema":{"type":"object","properties":{"authors":{"type":"array","items":{"$ref":"#/components/schemas/AuthorPublic"}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["authors","total","limit","offset"]}}}}}}},"/api/v1/users/authors/{slug}":{"get":{"tags":["Users","Authors"],"summary":"Autor nach Slug abrufen","description":"Gibt die öffentlichen Daten eines Autors zurück","parameters":[{"schema":{"type":"string","description":"Autor-Slug"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Autorendaten","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"$ref":"#/components/schemas/AuthorPublic"},"recentArticles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"regionSlug":{"type":"string"},"publishedAt":{"type":"string","nullable":true},"views":{"type":"number"}},"required":["id","title","slug","regionSlug","publishedAt","views"]}}},"required":["author","recentArticles"]}}}},"404":{"description":"Autor nicht gefunden"}}}},"/api/v1/users/authors/apply":{"post":{"tags":["Users","Authors"],"summary":"Autor werden (Bewerbung)","description":"Reicht eine Bewerbung ein, um Autor auf Copubli zu werden. Erfordert Klarnamenpflicht.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorApplication"}}}},"responses":{"201":{"description":"Bewerbung eingereicht","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"applicationId":{"type":"string"}},"required":["success","message","applicationId"]}}}},"400":{"description":"Ungültige Bewerbung"},"409":{"description":"Slug bereits vergeben oder bereits Autor"}}}},"/api/v1/users/check-slug/{slug}":{"get":{"tags":["Users"],"summary":"Slug-Verfügbarkeit prüfen","description":"Prüft ob ein Author-Slug bereits vergeben ist","parameters":[{"schema":{"type":"string","minLength":3},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Verfügbarkeitsstatus","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"slug":{"type":"string"}},"required":["available","slug"]}}}}}}},"/api/v1/users/me/payout":{"put":{"tags":["Users","Monetization"],"summary":"Auszahlungseinstellungen aktualisieren","description":"Setzt die IBAN für Auszahlungen. Nur Schweizer IBANs werden akzeptiert.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutSettings"}}}},"responses":{"200":{"description":"Einstellungen aktualisiert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}},"400":{"description":"Ungültige IBAN"}}}},"/api/v1/users/me/articles":{"get":{"tags":["Users","Articles"],"summary":"Meine Artikel abrufen","description":"Gibt alle Artikel des eingeloggten Benutzers zurück (Entwürfe und publizierte)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["DRAFT","PENDING","PUBLISHED","ARCHIVED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Liste eigener Artikel","content":{"application/json":{"schema":{"type":"object","properties":{"articles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"region":{"type":"string"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"views":{"type":"number"},"commentsCount":{"type":"number"}},"required":["id","title","slug","status","region","publishedAt","createdAt","updatedAt","views","commentsCount"]}},"total":{"type":"number"},"stats":{"type":"object","properties":{"published":{"type":"number"},"drafts":{"type":"number"},"pending":{"type":"number"},"totalViews":{"type":"number"}},"required":["published","drafts","pending","totalViews"]}},"required":["articles","total","stats"]}}}},"401":{"description":"Nicht authentifiziert"}}}},"/api/v1/users/me/stats":{"get":{"tags":["Users"],"summary":"Meine Statistiken abrufen","description":"Gibt Statistiken des eingeloggten Benutzers zurück","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Benutzer-Statistiken","content":{"application/json":{"schema":{"type":"object","properties":{"artikelCount":{"type":"number"},"viewsTotal":{"type":"number"},"kommentareCount":{"type":"number"}},"required":["artikelCount","viewsTotal","kommentareCount"]}}}}}}},"/api/v1/users/me/earnings":{"get":{"tags":["Users","Monetization"],"summary":"Verdienst-Übersicht abrufen","description":"Zeigt den aktuellen Verdienst, ausstehende Auszahlungen und Artikel-Performance","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["week","month","year","all"],"default":"month"},"required":false,"name":"period","in":"query"}],"responses":{"200":{"description":"Verdienst-Übersicht","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"totalEarnings":{"type":"number"},"pendingPayout":{"type":"number"},"lastPayout":{"type":"number","nullable":true},"lastPayoutDate":{"type":"string","nullable":true}},"required":["totalEarnings","pendingPayout","lastPayout","lastPayoutDate"]},"periodEarnings":{"type":"object","properties":{"period":{"type":"string"},"earnings":{"type":"number"},"views":{"type":"number"},"articleCount":{"type":"number"}},"required":["period","earnings","views","articleCount"]},"topArticles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"views":{"type":"number"},"earnings":{"type":"number"}},"required":["id","title","views","earnings"]}},"monthlyHistory":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"earnings":{"type":"number"},"views":{"type":"number"}},"required":["month","earnings","views"]}}},"required":["summary","periodEarnings","topArticles","monthlyHistory"]}}}}}}},"/api/v1/users/me/comments":{"get":{"tags":["Users","Comments"],"summary":"Meine Kommentare abrufen","description":"Gibt alle Kommentare des eingeloggten Benutzers zurück","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Liste eigener Kommentare","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"createdAt":{"type":"string"},"likes":{"type":"number"},"repliesCount":{"type":"number"},"article":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"region":{"type":"string"}},"required":["id","title","slug","region"]}},"required":["id","content","createdAt","likes","repliesCount","article"]}},"total":{"type":"number"}},"required":["comments","total"]}}}}}}},"/api/v1/users/me/organizations":{"get":{"tags":["Users"],"summary":"Meine Organisationen abrufen","description":"Gibt alle Organisationen zurück, in denen der Benutzer Mitglied ist","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Liste der Organisationen","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"role":{"type":"string"},"logo":{"type":"string","nullable":true}},"required":["id","name","slug","role","logo"]}}},"required":["organizations"]}}}}}}},"/api/v1/users/search":{"get":{"tags":["Users"],"summary":"Search users","description":"Search users by name or email for autocomplete (requires auth)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":2},"required":true,"name":"q","in":"query"},{"schema":{"type":"string","default":"10"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Matching users","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]}}},"required":["users"]}}}}}}},"/api/v1/subscriptions":{"get":{"tags":["Subscriptions"],"summary":"Alle Abonnements abrufen","description":"Gibt alle Abonnements des eingeloggten Benutzers zurück (Regionen, Organisationen, Autoren, Tags, Dossiers)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["region","organization","author","tag","dossier"],"description":"Nach Typ filtern"},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Liste der Abonnements","content":{"application/json":{"schema":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"counts":{"type":"object","properties":{"region":{"type":"number"},"organization":{"type":"number"},"author":{"type":"number"},"tag":{"type":"number"},"dossier":{"type":"number"},"total":{"type":"number"}},"required":["region","organization","author","tag","dossier","total"]}},"required":["subscriptions","counts"]}}}}}},"post":{"tags":["Subscriptions"],"summary":"Abonnement erstellen","description":"Abonniert eine Region, Organisation, einen Autor, Tag oder ein Dossier","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscription"}}}},"responses":{"201":{"description":"Abonnement erstellt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"subscription":{"$ref":"#/components/schemas/Subscription"}},"required":["success","subscription"]}}}},"400":{"description":"Ungültige Anfrage"},"404":{"description":"Ziel nicht gefunden"},"409":{"description":"Bereits abonniert"}}}},"/api/v1/subscriptions/{type}/{targetId}":{"delete":{"tags":["Subscriptions"],"summary":"Abonnement entfernen","description":"Entfernt ein Abonnement","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["region","organization","author","tag","dossier"]},"required":true,"name":"type","in":"path"},{"schema":{"type":"string"},"required":true,"name":"targetId","in":"path"}],"responses":{"200":{"description":"Abonnement entfernt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"404":{"description":"Abonnement nicht gefunden"}}}},"/api/v1/subscriptions/feed":{"get":{"tags":["Subscriptions"],"summary":"Personalisierter Feed","description":"Gibt Artikel und Events basierend auf den Abonnements zurück","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","default":"20"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0"},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","description":"Kommagetrennte Liste: region,organization,author,tag"},"required":false,"name":"types","in":"query"},{"schema":{"type":"string","description":"Kommagetrennte Liste: article,event"},"required":false,"name":"contentTypes","in":"query"}],"responses":{"200":{"description":"Feed-Einträge","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedItem"}},"total":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["items","total","hasMore"]}}}}}}},"/api/v1/subscriptions/sync":{"post":{"tags":["Subscriptions"],"summary":"Lokale Abonnements synchronisieren","description":"Synchronisiert lokale (localStorage) Abonnements mit dem Server. Nützlich nach dem Login.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["region","organization","author","tag","dossier"]},"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["type","id","name"]}}},"required":["subscriptions"]}}}},"responses":{"200":{"description":"Synchronisierung erfolgreich","content":{"application/json":{"schema":{"type":"object","properties":{"synced":{"type":"number"},"merged":{"type":"number"},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}}},"required":["synced","merged","subscriptions"]}}}}}}},"/api/v1/comments/article/{articleId}":{"get":{"tags":["Comments"],"summary":"Kommentare zu einem Artikel","description":"Gibt alle Kommentare zu einem Artikel zurück, hierarchisch sortiert","parameters":[{"schema":{"type":"string"},"required":true,"name":"articleId","in":"path"},{"schema":{"type":"string","enum":["newest","oldest","popular"],"default":"newest"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Kommentare","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"total":{"type":"number"}},"required":["comments","total"]}}}}}}},"/api/v1/comments/{commentId}/replies":{"get":{"tags":["Comments"],"summary":"Antworten auf einen Kommentar","parameters":[{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"}],"responses":{"200":{"description":"Antworten","content":{"application/json":{"schema":{"type":"object","properties":{"replies":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}},"required":["replies"]}}}}}}},"/api/v1/comments":{"post":{"tags":["Comments"],"summary":"Kommentar erstellen","description":"Erstellt einen neuen Kommentar. Erfordert Anmeldung und Klarname.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateComment"}}}},"responses":{"201":{"description":"Kommentar erstellt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"comment":{"$ref":"#/components/schemas/Comment"}},"required":["success","comment"]}}}},"400":{"description":"Ungültiger Kommentar"},"404":{"description":"Artikel nicht gefunden"}}}},"/api/v1/comments/{commentId}/like":{"post":{"tags":["Comments"],"summary":"Kommentar liken","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"}],"responses":{"200":{"description":"Like gesetzt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"likeCount":{"type":"number"}},"required":["success","likeCount"]}}}}}}},"/api/v1/comments/{commentId}/dislike":{"post":{"tags":["Comments"],"summary":"Kommentar disliken","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"}],"responses":{"200":{"description":"Dislike gesetzt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"dislikeCount":{"type":"number"}},"required":["success","dislikeCount"]}}}}}}},"/api/v1/comments/{commentId}/report":{"post":{"tags":["Comments"],"summary":"Kommentar melden","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"commentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","enum":["spam","harassment","misinformation","other"]},"details":{"type":"string","maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"Meldung eingereicht","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}}}}},"/api/v1/comments/notes/article/{articleId}":{"get":{"tags":["Comments","Community Notes"],"summary":"Gemeinschaftsnotizen zu einem Artikel","description":"Gibt alle sichtbaren Gemeinschaftsnotizen zu einem Artikel zurück","parameters":[{"schema":{"type":"string"},"required":true,"name":"articleId","in":"path"}],"responses":{"200":{"description":"Gemeinschaftsnotizen","content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"array","items":{"$ref":"#/components/schemas/CommunityNote"}},"canCreateNote":{"type":"boolean"}},"required":["notes","canCreateNote"]}}}}}}},"/api/v1/comments/notes":{"post":{"tags":["Comments","Community Notes"],"summary":"Gemeinschaftsnotiz erstellen","description":"Erstellt eine neue Gemeinschaftsnotiz. Erfordert Contributor-Status (5+ akzeptierte Beiträge)","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCommunityNote"}}}},"responses":{"201":{"description":"Notiz erstellt (pending Bewertung)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"note":{"$ref":"#/components/schemas/CommunityNote"},"message":{"type":"string"}},"required":["success","note","message"]}}}},"403":{"description":"Keine Berechtigung (Contributor-Status erforderlich)"}}}},"/api/v1/comments/notes/{noteId}/rate":{"post":{"tags":["Comments","Community Notes"],"summary":"Gemeinschaftsnotiz bewerten","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"noteId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"helpful":{"type":"boolean"}},"required":["helpful"]}}}},"responses":{"200":{"description":"Bewertung gespeichert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"helpfulCount":{"type":"number"},"notHelpfulCount":{"type":"number"},"nowShown":{"type":"boolean"}},"required":["success","helpfulCount","notHelpfulCount","nowShown"]}}}}}}},"/api/v1/payouts":{"get":{"tags":["Payouts","Monetization"],"summary":"Auszahlungs-Historie","description":"Gibt alle bisherigen Auszahlungen des eingeloggten Autors zurück","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["PENDING","PROCESSING","COMPLETED","FAILED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","default":"20"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Auszahlungs-Historie","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutHistory"}}}},"403":{"description":"Keine Autoren-Berechtigung"}}}},"/api/v1/payouts/breakdown":{"get":{"tags":["Payouts","Monetization"],"summary":"Einnahmen pro Artikel","description":"Zeigt detaillierte Einnahmen pro Artikel für einen bestimmten Zeitraum","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["week","month","year"],"default":"month"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string"},"required":false,"name":"year","in":"query"},{"schema":{"type":"string"},"required":false,"name":"month","in":"query"}],"responses":{"200":{"description":"Einnahmen-Aufschlüsselung","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"},"label":{"type":"string"}},"required":["start","end","label"]},"totals":{"type":"object","properties":{"views":{"type":"number"},"grossRevenue":{"type":"number"},"authorShare":{"type":"number"},"platformShare":{"type":"number"},"notesShare":{"type":"number"}},"required":["views","grossRevenue","authorShare","platformShare","notesShare"]},"articles":{"type":"array","items":{"$ref":"#/components/schemas/RevenueBreakdown"}},"revenueModel":{"type":"object","properties":{"authorPercentage":{"type":"number"},"platformPercentage":{"type":"number"},"notesPercentage":{"type":"number"},"reservePercentage":{"type":"number"},"cpmRate":{"type":"number"}},"required":["authorPercentage","platformPercentage","notesPercentage","reservePercentage","cpmRate"]}},"required":["period","totals","articles","revenueModel"]}}}}}}},"/api/v1/payouts/settings":{"get":{"tags":["Payouts","Monetization"],"summary":"Auszahlungseinstellungen","description":"Gibt die aktuellen Auszahlungseinstellungen zurück","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Einstellungen","content":{"application/json":{"schema":{"type":"object","properties":{"iban":{"type":"string","nullable":true},"ibanVerified":{"type":"boolean"},"ibanMasked":{"type":"string","nullable":true},"minimumPayout":{"type":"number"},"payoutFrequency":{"type":"string"},"nextPayoutDate":{"type":"string","nullable":true},"pendingAmount":{"type":"number"}},"required":["iban","ibanVerified","ibanMasked","minimumPayout","payoutFrequency","nextPayoutDate","pendingAmount"]}}}}}},"put":{"tags":["Payouts","Monetization"],"summary":"Auszahlungseinstellungen aktualisieren","description":"Aktualisiert IBAN und andere Auszahlungseinstellungen","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"iban":{"type":"string","pattern":"^CH[0-9]{2}\\s?([0-9]{4}\\s?){4}[0-9]$|^CH[0-9]{19}$"}}}}}},"responses":{"200":{"description":"Einstellungen aktualisiert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"ibanMasked":{"type":"string","nullable":true},"verificationPending":{"type":"boolean"}},"required":["success","message","ibanMasked","verificationPending"]}}}},"400":{"description":"Ungültige IBAN"}}}},"/api/v1/payouts/request":{"post":{"tags":["Payouts","Monetization"],"summary":"Auszahlung anfordern","description":"Fordert eine manuelle Auszahlung an (normalerweise automatisch am Monatsende)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Auszahlung angefordert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"payout":{"$ref":"#/components/schemas/Payout"}},"required":["success","message"]}}}},"400":{"description":"Mindestbetrag nicht erreicht oder keine IBAN hinterlegt"}}}},"/api/v1/payouts/stats/platform":{"get":{"tags":["Payouts","Admin"],"summary":"Plattform-Statistiken (Admin)","description":"Zeigt plattformweite Monetarisierungs-Statistiken","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Plattform-Statistiken","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string"},"totalViews":{"type":"number"},"totalRevenue":{"type":"number"},"totalPaidToAuthors":{"type":"number"},"totalPaidToNotes":{"type":"number"},"platformRevenue":{"type":"number"},"activeAuthors":{"type":"number"},"averageEarningsPerAuthor":{"type":"number"},"topAuthors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"earnings":{"type":"number"},"articleCount":{"type":"number"}},"required":["id","name","earnings","articleCount"]}}},"required":["period","totalViews","totalRevenue","totalPaidToAuthors","totalPaidToNotes","platformRevenue","activeAuthors","averageEarningsPerAuthor","topAuthors"]}}}},"403":{"description":"Keine Admin-Berechtigung"}}}},"/api/v1/whatsapp/webhook":{"post":{"tags":["WhatsApp"],"summary":"Webhook für eingehende WhatsApp-Nachrichten","description":"Empfängt Nachrichten von WhatsApp (via OpenClaw). Verarbeitet Text, Bilder und Sprachnachrichten.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messageId":{"type":"string"},"from":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"text":{"type":"string"},"mediaUrls":{"type":"array","items":{"type":"string"}},"voiceUrl":{"type":"string"},"voiceDuration":{"type":"number"},"timestamp":{"type":"string"}},"required":["messageId","from"]}}}},"responses":{"200":{"description":"Nachricht empfangen","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"submissionId":{"type":"string"},"response":{"type":"string"}},"required":["success","submissionId"]}}}},"400":{"description":"Ungültige Nachricht"}}}},"/api/v1/whatsapp/phone":{"put":{"tags":["WhatsApp","Users"],"summary":"Handynummer hinterlegen","description":"Hinterlegt oder aktualisiert die Handynummer für WhatsApp-Integration","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"}},"required":["phone"]}}}},"responses":{"200":{"description":"Nummer gespeichert, Verifizierung gestartet","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"verificationPending":{"type":"boolean"}},"required":["success","message","verificationPending"]}}}},"409":{"description":"Nummer bereits von anderem Konto verwendet"}}}},"/api/v1/whatsapp/verify":{"post":{"tags":["WhatsApp","Users"],"summary":"Handynummer verifizieren","description":"Verifiziert die Handynummer mit dem per WhatsApp gesendeten Code","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":6,"maxLength":6}},"required":["code"]}}}},"responses":{"200":{"description":"Nummer verifiziert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"whatsappEnabled":{"type":"boolean"}},"required":["success","whatsappEnabled"]}}}},"400":{"description":"Ungültiger Code"}}}},"/api/v1/whatsapp/settings":{"put":{"tags":["WhatsApp","Users"],"summary":"WhatsApp-Einstellungen","description":"Aktiviert/deaktiviert WhatsApp-Features","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"whatsappEnabled":{"type":"boolean"},"notifyWhatsApp":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Einstellungen aktualisiert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"settings":{"type":"object","properties":{"phone":{"type":"string","nullable":true},"phoneVerified":{"type":"boolean"},"whatsappEnabled":{"type":"boolean"},"notifyWhatsApp":{"type":"boolean"}},"required":["phone","phoneVerified","whatsappEnabled","notifyWhatsApp"]}},"required":["success","settings"]}}}}}}},"/api/v1/whatsapp/submissions":{"get":{"tags":["WhatsApp"],"summary":"Meine WhatsApp-Einreichungen","description":"Liste aller per WhatsApp eingereichten Artikel/Events","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["PENDING","PROCESSING","AWAITING_INFO","DRAFT_CREATED","PUBLISHED","REJECTED","FAILED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","default":"20"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Einreichungen","content":{"application/json":{"schema":{"type":"object","properties":{"submissions":{"type":"array","items":{"$ref":"#/components/schemas/WhatsAppSubmission"}},"total":{"type":"number"}},"required":["submissions","total"]}}}}}}},"/api/v1/whatsapp/submissions/{id}/approve":{"post":{"tags":["WhatsApp"],"summary":"Entwurf freigeben","description":"Gibt einen aus WhatsApp-Nachricht erstellten Artikel-Entwurf zur Publikation frei","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"content":{"type":"string"},"region":{"type":"string"},"category":{"type":"string"}}}}}},"responses":{"200":{"description":"Artikel publiziert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"articleId":{"type":"string"},"articleUrl":{"type":"string"}},"required":["success","articleId","articleUrl"]}}}}}}},"/api/v1/whatsapp/submissions/{id}/reject":{"post":{"tags":["WhatsApp"],"summary":"Einreichung ablehnen","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Abgelehnt","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/api/v1/whatsapp/interview/start":{"post":{"tags":["WhatsApp","Podcast"],"summary":"Podcast-Interview starten","description":"Startet ein asynchrones Interview per WhatsApp-Sprachnachrichten","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"guestPhone":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"guestName":{"type":"string"},"guestRole":{"type":"string"},"topic":{"type":"string"},"questions":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":10},"scheduledAt":{"type":"string"}},"required":["guestPhone","guestName","topic","questions"]}}}},"responses":{"201":{"description":"Interview gestartet","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"interviewId":{"type":"string"},"message":{"type":"string"}},"required":["success","interviewId","message"]}}}}}}},"/api/v1/whatsapp/interview/{id}":{"get":{"tags":["WhatsApp","Podcast"],"summary":"Interview-Status","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Interview-Details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"guestName":{"type":"string"},"topic":{"type":"string"},"status":{"type":"string"},"questionsAsked":{"type":"number"},"questionsTotal":{"type":"number"},"transcript":{"type":"string","nullable":true}},"required":["id","guestName","topic","status","questionsAsked","questionsTotal","transcript"]}}}}}}},"/api/v1/media/upload":{"post":{"tags":["Media"],"summary":"Upload media file","description":"Upload an image or other media file","security":[{"bearerAuth":[]}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true},"alt":{"type":"string"},"caption":{"type":"string"},"credit":{"type":"string"},"tags":{"type":"string"},"isPublic":{"type":"string"},"organizationId":{"type":"string"}}}}}},"responses":{"201":{"description":"File uploaded","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["id","url","filename","mimeType","size"]}}}},"400":{"description":"Invalid file"},"401":{"description":"Not authenticated"}}}},"/api/v1/media":{"get":{"tags":["Media"],"summary":"List media files","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["image","video","audio","document","all"],"default":"all"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organizationId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"tag","in":"query"},{"schema":{"type":"string","enum":["mine","org","public","all"],"default":"all"},"required":false,"name":"source","in":"query"},{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"List of media files","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"filename":{"type":"string"},"originalName":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"width":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"alt":{"type":"string","nullable":true},"caption":{"type":"string","nullable":true},"credit":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","url","filename","originalName","mimeType","size","width","height","alt","caption","credit","createdAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["data","nextCursor"]}}}}}}},"/api/v1/media/{id}":{"get":{"tags":["Media"],"summary":"Get media details","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Media details"},"404":{"description":"Not found"}}},"put":{"tags":["Media"],"summary":"Update media metadata","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"alt":{"type":"string","nullable":true},"caption":{"type":"string","nullable":true},"credit":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"isPublic":{"type":"boolean"},"focusX":{"type":"number","minimum":0,"maximum":1},"focusY":{"type":"number","minimum":0,"maximum":1}}}}}},"responses":{"200":{"description":"Updated"},"403":{"description":"Not authorized"},"404":{"description":"Not found"}}},"delete":{"tags":["Media"],"summary":"Delete media file","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted"},"403":{"description":"Not authorized"},"404":{"description":"Not found"}}}},"/api/v1/image-archive":{"get":{"tags":["ImageArchive"],"summary":"List archived images","description":"Get paginated list of images from the archive","parameters":[{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"}],"responses":{"200":{"description":"List of images","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"localPath":{"type":"string"},"thumbnailPath":{"type":"string","nullable":true},"previewPath":{"type":"string","nullable":true},"cdnUrl":{"type":"string","nullable":true},"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"sizeBytes":{"type":"number"},"mimeType":{"type":"string"},"credit":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"sourceUrl":{"type":"string","nullable":true},"keywords":{"type":"array","items":{"type":"string"}},"category":{"type":"string","nullable":true},"isSymbol":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","filename","localPath","thumbnailPath","previewPath","cdnUrl","url","width","height","sizeBytes","mimeType","credit","source","sourceUrl","keywords","category","isSymbol","createdAt"]}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["data","total","page","pageSize"]}}}}}}},"/api/v1/image-archive/{id}":{"get":{"tags":["ImageArchive"],"summary":"Get image details","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Image details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"credit":{"type":"string","nullable":true},"keywords":{"type":"array","items":{"type":"string"}}},"required":["id","filename","credit","keywords"]}}}},"404":{"description":"Image not found"}}}},"/api/v1/admin/stats":{"get":{"tags":["Admin"],"summary":"Admin-Dashboard Statistiken","description":"Übersicht aller wichtigen Zahlen für Admins","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Statistiken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStats"}}}}}}},"/api/v1/admin/users":{"get":{"tags":["Admin"],"summary":"Alle Benutzer auflisten","description":"Liste aller Benutzer mit Suchfunktion und Filteroptionen","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Suchbegriff (Name, E-Mail)"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","enum":["READER","AUTHOR","REGION_ADMIN","ADMIN"]},"required":false,"name":"role","in":"query"},{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Benutzerliste","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/AdminUser"}},"total":{"type":"number"}},"required":["users","total"]}}}}}}},"/api/v1/admin/users/{id}":{"get":{"tags":["Admin"],"summary":"Benutzer-Details abrufen","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Benutzer-Details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUser"}}}},"404":{"description":"Benutzer nicht gefunden"}}}},"/api/v1/admin/users/{id}/role":{"put":{"tags":["Admin"],"summary":"Benutzer-Rolle ändern","description":"Ändert die Rolle eines Benutzers (READER, AUTHOR, ADMIN)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["READER","AUTHOR","REGION_ADMIN","ADMIN"]}},"required":["role"]}}}},"responses":{"200":{"description":"Rolle aktualisiert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"user":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"}},"required":["id","role"]}},"required":["success","user"]}}}},"404":{"description":"Benutzer nicht gefunden"}}}},"/api/v1/admin/users/{id}/organizations":{"put":{"tags":["Admin"],"summary":"Organisations-Zugehörigkeiten aktualisieren","description":"Fügt einen Benutzer zu Organisationen hinzu oder entfernt ihn","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"add":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string"},"role":{"type":"string","enum":["MEMBER","ADMIN","OWNER"],"default":"MEMBER"}},"required":["organizationId"]}},"remove":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Mitgliedschaften aktualisiert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"memberships":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string"},"organizationName":{"type":"string"},"role":{"type":"string"}},"required":["organizationId","organizationName","role"]}}},"required":["success","memberships"]}}}}}}},"/api/v1/admin/organizations":{"get":{"tags":["Admin"],"summary":"Alle Organisationen auflisten","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","enum":["UNCLAIMED","PENDING","CLAIMED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Organisationsliste","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"region":{"type":"string"},"memberCount":{"type":"number"},"articleCount":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","name","slug","status","region","memberCount","articleCount","createdAt"]}},"total":{"type":"number"}},"required":["organizations","total"]}}}}}}},"/api/v1/admin/impersonate":{"post":{"tags":["Admin"],"summary":"Als Benutzer anmelden","description":"Startet eine Impersonation-Session. Der Admin kann als ein anderer Benutzer agieren.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"}},"required":["userId"]}}}},"responses":{"200":{"description":"Impersonation gestartet","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"impersonating":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]},"token":{"type":"string","description":"Impersonation-Token für den Client"}},"required":["success","impersonating","token"]}}}},"400":{"description":"Kann sich nicht selbst impersonieren"},"404":{"description":"Benutzer nicht gefunden"}}}},"/api/v1/admin/stop-impersonate":{"post":{"tags":["Admin"],"summary":"Impersonation beenden","description":"Beendet die Impersonation-Session und kehrt zum Admin-Account zurück","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"Impersonation beendet","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}}}}},"/api/v1/admin/organizations/search":{"get":{"tags":["Admin"],"summary":"Organisationen suchen","description":"Suche für Autocomplete bei Org-Zuweisungen","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"q","in":"query"},{"schema":{"type":"string","default":"10"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Suchergebnisse","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"]}}},"required":["organizations"]}}}}}}},"/api/v1/admin/monetization":{"get":{"tags":["Admin"],"summary":"Monetarisierungs-Anträge auflisten","description":"Liste aller Monetarisierungsanträge mit Filteroptionen","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["NONE","PENDING","APPROVED","REJECTED","SUSPENDED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Antragsliste","content":{"application/json":{"schema":{"type":"object","properties":{"applications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string"},"monetizationStatus":{"type":"string"},"monetizationAppliedAt":{"type":"string","nullable":true},"payoutIban":{"type":"string","nullable":true},"articleCount":{"type":"number"},"totalEarnings":{"type":"number"}},"required":["id","name","email","monetizationStatus","monetizationAppliedAt","payoutIban","articleCount","totalEarnings"]}},"total":{"type":"number"}},"required":["applications","total"]}}}}}}},"/api/v1/admin/monetization/{id}":{"put":{"tags":["Admin"],"summary":"Monetarisierung genehmigen/ablehnen","description":"Ändert den Monetarisierungsstatus eines Benutzers","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["APPROVED","REJECTED","SUSPENDED"]},"note":{"type":"string","description":"Begründung bei Ablehnung"}},"required":["status"]}}}},"responses":{"200":{"description":"Status aktualisiert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"user":{"type":"object","properties":{"id":{"type":"string"},"monetizationStatus":{"type":"string"}},"required":["id","monetizationStatus"]}},"required":["success","user"]}}}},"404":{"description":"Benutzer nicht gefunden"}}}},"/api/v1/admin/monetization/orgs":{"get":{"tags":["Admin"],"summary":"Organisations-Monetarisierungsanträge auflisten","description":"Liste aller Monetarisierungsanträge von Organisationen","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["NONE","PENDING","APPROVED","REJECTED","SUSPENDED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","default":"50"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","default":"0"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Antragsliste","content":{"application/json":{"schema":{"type":"object","properties":{"applications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"monetizationStatus":{"type":"string"},"monetizationAppliedAt":{"type":"string","nullable":true},"payoutIban":{"type":"string","nullable":true},"articleCount":{"type":"number"},"totalEarnings":{"type":"number"}},"required":["id","name","slug","monetizationStatus","monetizationAppliedAt","payoutIban","articleCount","totalEarnings"]}},"total":{"type":"number"}},"required":["applications","total"]}}}}}}},"/api/v1/admin/monetization/orgs/{id}":{"put":{"tags":["Admin"],"summary":"Org-Monetarisierung genehmigen/ablehnen","description":"Ändert den Monetarisierungsstatus einer Organisation","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["APPROVED","REJECTED","SUSPENDED"]},"note":{"type":"string","description":"Begründung bei Ablehnung"}},"required":["status"]}}}},"responses":{"200":{"description":"Status aktualisiert","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organization":{"type":"object","properties":{"id":{"type":"string"},"monetizationStatus":{"type":"string"}},"required":["id","monetizationStatus"]}},"required":["success","organization"]}}}},"404":{"description":"Organisation nicht gefunden"}}}},"/api/v1/admin/articles":{"get":{"tags":["Admin"],"summary":"List all articles","description":"Get all articles for admin management","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"}],"responses":{"200":{"description":"List of articles","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string"},"category":{"type":"string"},"region":{"type":"string"},"authorName":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"views":{"type":"number"},"relevanceScore":{"type":"number","nullable":true},"relevanceReason":{"type":"string","nullable":true},"agentCostUsd":{"type":"number","nullable":true},"agentInputTokens":{"type":"number","nullable":true},"agentOutputTokens":{"type":"number","nullable":true}},"required":["id","title","slug","status","category","region","authorName","publishedAt","createdAt","views","relevanceScore","relevanceReason","agentCostUsd","agentInputTokens","agentOutputTokens"]}},"nextCursor":{"type":"string","nullable":true}},"required":["data","nextCursor"]}}}}}}},"/api/v1/admin/articles/{id}/preview":{"get":{"tags":["Admin"],"summary":"Preview article by ID","description":"Get full article details for admin preview (any status)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Article preview"},"404":{"description":"Article not found"}}}}}}