{
  "openapi": "3.1.1",
  "info": {
    "title": "Postlip Metrics Content API",
    "version": "1.0.0",
    "description": "Sitelerin ve uygulamaların blogu kendi tasarımıyla çizmek için okuduğu API: yalnız YAYINDAKİ yazılar (taslak, onaydaki sürüm ya da yayından kaldırılmış yazı hiç dönmez; çalışma sürümü yalnız editörlerin verdiği önizleme belirteciyle). Kimlik: organizasyonun panelden oluşturduğu API anahtarı, kapsam `content:read` (yalnız bu kapsamlı anahtar uygulamanın «içerik anahtarı»dır), `Authorization: Bearer mk_…` — yalnız sunucu tarafında. Önbellek: `ETag` / `Last-Modified`, `If-None-Match` / `If-Modified-Since` ile 304; değişiklikler imzalı yayın webhook'uyla (`content.post.published|updated|unpublished`, `Metrics-Signature`) duyurulur, site önbelleğini uzun tutup webhook'ta yeniler. İçerik HTML değil blok belgesidir; `html` alanı Postlip Metrics'in kaçışlayarak çizdiği güvenli HTML'dir. Hata gövdesi `{ \"error\": { \"code\", \"message\", \"traceId\" } }`, `message` isteğin dilinde (`Accept-Language`: tr, en)."
  },
  "servers": [
    {
      "url": "https://api.metrics.example",
      "description": "Content API"
    }
  ],
  "tags": [
    {
      "name": "İçerik (blog)",
      "description": "Yazılar (blok içerik, SEO, kapak, kategori, etiket, yazarlar), iş akışı (onaya gönderme, onay, dört göz, zamanlama, yayın, yayından kaldırma, arşiv), sürümler ve farkları, zaman çizelgesi, yorumlar, süreli önizleme bağlantıları, yasaklı ifadeler, ayarlar; siteler için İçerik API’si (yalnız yayındaki yazılar) ve yayın webhook’ları."
    }
  ],
  "paths": {
    "/v1/content/apps/{appId}/assets/{assetId}": {
      "get": {
        "tags": [
          "İçerik (blog)"
        ],
        "summary": "Görselin dosyası",
        "description": "Yayındaki bir yazının (ya da yazarının) gösterdiği görselin baytları — görselleri kendi sunucusunda tutan siteler için; kütüphanenin geri kalanı bu anahtarla okunamaz. Sürüm: `original` (metadata temizlenmiş), `jpg`, `medium` (1080 px WebP), `thumb` (320 px WebP).\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `content:read`.",
        "operationId": "contentApi.asset",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "required": true,
            "description": "Dosyanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "variant",
            "in": "query",
            "required": false,
            "schema": {
              "default": "original",
              "type": "string",
              "enum": [
                "original",
                "jpg",
                "medium",
                "thumb"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Görsel dosyası.",
            "headers": {
              "Content-Disposition": {
                "description": "attachment; filename=\"…\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "content:read"
        ]
      }
    },
    "/v1/content/apps/{appId}/authors": {
      "get": {
        "tags": [
          "İçerik (blog)"
        ],
        "summary": "Yazarlar",
        "description": "Etkin ya da yayında yazısı olan yazarlar, profilleriyle. Önbellek: `ETag` (gövdenin özeti) ve `Last-Modified` (uygulamanın sunulan içeriğinin son değişikliği; imzalı görsel bağlantıları saatte bir yenilendiği için en eski bu saatin başı); `If-None-Match` ya da `If-Modified-Since` eşleşirse 304, gövdesiz. `Cache-Control: private, max-age=60`, `Vary: Authorization`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `content:read`.",
        "operationId": "contentApi.authors",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentApiAuthorList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "content:read"
        ]
      }
    },
    "/v1/content/apps/{appId}/categories": {
      "get": {
        "tags": [
          "İçerik (blog)"
        ],
        "summary": "Kategoriler",
        "description": "Yayındaki yazı sayılarıyla. Önbellek: `ETag` (gövdenin özeti) ve `Last-Modified` (uygulamanın sunulan içeriğinin son değişikliği; imzalı görsel bağlantıları saatte bir yenilendiği için en eski bu saatin başı); `If-None-Match` ya da `If-Modified-Since` eşleşirse 304, gövdesiz. `Cache-Control: private, max-age=60`, `Vary: Authorization`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `content:read`.",
        "operationId": "contentApi.categories",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentApiCategoryList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "content:read"
        ]
      }
    },
    "/v1/content/apps/{appId}/posts": {
      "get": {
        "tags": [
          "İçerik (blog)"
        ],
        "summary": "Yayındaki yazılar",
        "description": "Yalnız YAYINDAKİ yazılar: taslak, onaydaki sürüm ya da yayından kaldırılmış yazı bu uçlardan hiç dönmez (yalnız önizleme belirteciyle). Filtreler: dil, kategori (adres), etiket, yazar (adres), yayın yeri (`web` site, `app` uygulama içi akış), arama, `updatedSince` (artımlı eşitleme); sıralama ilk yayın ya da son güncelleme; imleç sayfalama (en çok 100). Önbellek: `ETag` (gövdenin özeti) ve `Last-Modified` (uygulamanın sunulan içeriğinin son değişikliği; imzalı görsel bağlantıları saatte bir yenilendiği için en eski bu saatin başı); `If-None-Match` ya da `If-Modified-Since` eşleşirse 304, gövdesiz. `Cache-Control: private, max-age=60`, `Vary: Authorization`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `content:read`.",
        "operationId": "contentApi.posts",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 5,
              "pattern": "^[a-z]{2}(?:-[A-Z]{2})?$"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 50
            }
          },
          {
            "name": "author",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "feed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "app"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "published",
              "type": "string",
              "enum": [
                "published",
                "updated"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentApiPostPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "content:read"
        ]
      }
    },
    "/v1/content/apps/{appId}/posts/{slug}": {
      "get": {
        "tags": [
          "İçerik (blog)"
        ],
        "summary": "Yazı (adresiyle)",
        "description": "Yazının belgesi: blok içerik, Postlip Metrics'in kaçışlayarak çizdiği HTML (sabit etiket seti; betik, stil, satır içi HTML yok), düz metin, içindekiler, okuma süresi, yazarlar ve profilleri, SEO (başlık, açıklama, kanonik adres, noindex, OG görseli), schema.org JSON-LD (`structuredData` ve `<script>` için kaçışlanmış `jsonLd`), çeviriler, eski adresler, görseller (süreli imzalı bağlantı + anahtarla okunan kalıcı `file` adresi). Eski bir adres `{ kind: \"redirect\" }` döner (API 301 vermez: istemci sessizce izleyip eski adresi tutmasın — site kendi 301'ini verir); yayından kaldırılmış yazının adresi 410 `CONTENT_POST_GONE`, bilinmeyen 404. Önbellek: `ETag` (gövdenin özeti) ve `Last-Modified` (uygulamanın sunulan içeriğinin son değişikliği; imzalı görsel bağlantıları saatte bir yenilendiği için en eski bu saatin başı); `If-None-Match` ya da `If-Modified-Since` eşleşirse 304, gövdesiz. `Cache-Control: private, max-age=60`, `Vary: Authorization`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `content:read`.",
        "operationId": "contentApi.post",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Yazının adresi (slug); eski bir adres yenisine yönlendirme döner.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentApiPostResolution"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "content:read"
        ]
      }
    },
    "/v1/content/apps/{appId}/preview/{token}": {
      "get": {
        "tags": [
          "İçerik (blog)"
        ],
        "summary": "Önizleme (belirteçle)",
        "description": "Editörlerin verdiği önizleme belirteciyle çalışma sürümünün belgesi (`preview: true`, `seo.noindex: true`): sitenin kendi tasarımıyla önizleme sayfası için. Belirteç anahtarın uygulamasına ait olmalı. `Cache-Control: no-store`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `content:read`.",
        "operationId": "contentApi.preview",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "Belirteç (paylaşım bağlantısı `rs_…`, ileti takip bağlantısı `o1.…` / `c1.…` / `u1.…`, sağlayıcı webhook adresi, yazı önizlemesi `cp_…`; uca göre); içinde kiracı kimliği yok.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentApiPost"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "content:read"
        ]
      }
    },
    "/v1/content/apps/{appId}/sitemap": {
      "get": {
        "tags": [
          "İçerik (blog)"
        ],
        "summary": "Site haritası",
        "description": "Yayındaki, `noindex` olmayan yazıların adresi, son güncellemesi ve çevirileri (hreflang); imleç sayfalama (en çok 5 000). Önbellek: `ETag` (gövdenin özeti) ve `Last-Modified` (uygulamanın sunulan içeriğinin son değişikliği; imzalı görsel bağlantıları saatte bir yenilendiği için en eski bu saatin başı); `If-None-Match` ya da `If-Modified-Since` eşleşirse 304, gövdesiz. `Cache-Control: private, max-age=60`, `Vary: Authorization`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `content:read`.",
        "operationId": "contentApi.sitemap",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,512}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 1000,
              "type": "integer",
              "minimum": 1,
              "maximum": 5000
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 5,
              "pattern": "^[a-z]{2}(?:-[A-Z]{2})?$"
            }
          },
          {
            "name": "feed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "app"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentApiSitemap"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "content:read"
        ]
      }
    },
    "/v1/content/apps/{appId}/tags": {
      "get": {
        "tags": [
          "İçerik (blog)"
        ],
        "summary": "Etiketler",
        "description": "Yayındaki yazılardaki etiketler, sayılarıyla. Önbellek: `ETag` (gövdenin özeti) ve `Last-Modified` (uygulamanın sunulan içeriğinin son değişikliği; imzalı görsel bağlantıları saatte bir yenilendiği için en eski bu saatin başı); `If-None-Match` ya da `If-Modified-Since` eşleşirse 304, gövdesiz. `Cache-Control: private, max-age=60`, `Vary: Authorization`.\n\nManagement API anahtarı gerekir (`Authorization: Bearer mk_…`); işlem anahtarın organizasyonunda ve uygulama kapsamında tek bir RLS işleminde çalışır.\n\nGerekli kapsam: `content:read`.",
        "operationId": "contentApi.tags",
        "security": [
          {
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "description": "Uygulamanın kimliği.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentApiTagList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-access": "api_key",
        "x-scopes": [
          "content:read"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ContentApiAuthor": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "bio": {
            "type": [
              "string",
              "null"
            ]
          },
          "avatar": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContentApiImage"
              },
              {
                "type": "null"
              }
            ]
          },
          "websiteUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "slug",
          "name",
          "title",
          "bio",
          "avatar",
          "websiteUrl",
          "links"
        ],
        "additionalProperties": false
      },
      "ContentApiAuthorList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "bio": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "avatar": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ContentApiImage"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "websiteUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "links": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "postCount": {
                  "type": "integer"
                }
              },
              "required": [
                "slug",
                "name",
                "title",
                "bio",
                "avatar",
                "websiteUrl",
                "links",
                "postCount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "ContentApiCategoryList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position": {
                  "type": "integer"
                },
                "postCount": {
                  "type": "integer"
                }
              },
              "required": [
                "slug",
                "name",
                "description",
                "position",
                "postCount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "ContentApiCategoryRef": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "additionalProperties": false
      },
      "ContentApiImage": {
        "type": "object",
        "properties": {
          "assetId": {
            "$ref": "#/components/schemas/Id"
          },
          "url": {
            "type": "string"
          },
          "expiresAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "file": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "alt": {
            "type": [
              "string",
              "null"
            ]
          },
          "variants": {
            "type": "object",
            "properties": {
              "medium": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "thumb": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "medium",
              "thumb"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "assetId",
          "url",
          "expiresAt",
          "file",
          "mimeType",
          "width",
          "height",
          "alt",
          "variants"
        ],
        "additionalProperties": false
      },
      "ContentApiPost": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "slug": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContentApiCategoryRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContentApiAuthor"
            }
          },
          "cover": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContentApiImage"
              },
              {
                "type": "null"
              }
            ]
          },
          "feeds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "web",
                "app"
              ]
            }
          },
          "readingMinutes": {
            "type": "integer"
          },
          "publishedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "revision": {
            "type": "integer"
          },
          "body": {
            "$ref": "#/components/schemas/ContentBodyResponse"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "toc": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "level": {
                  "type": "integer"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "level",
                "text"
              ],
              "additionalProperties": false
            }
          },
          "wordCount": {
            "type": "integer"
          },
          "seo": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "canonicalUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "noindex": {
                "type": "boolean"
              },
              "ogImage": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ContentApiImage"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "title",
              "description",
              "canonicalUrl",
              "noindex",
              "ogImage"
            ],
            "additionalProperties": false
          },
          "structuredData": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "jsonLd": {
            "type": "string"
          },
          "translations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "locale": {
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "locale",
                "slug",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "previousSlugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "preview": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "slug",
          "locale",
          "title",
          "excerpt",
          "url",
          "category",
          "tags",
          "authors",
          "cover",
          "feeds",
          "readingMinutes",
          "publishedAt",
          "updatedAt",
          "revision",
          "body",
          "html",
          "text",
          "toc",
          "wordCount",
          "seo",
          "structuredData",
          "jsonLd",
          "translations",
          "previousSlugs",
          "preview"
        ],
        "additionalProperties": false
      },
      "ContentApiPostPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContentApiPostSummary"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "ContentApiPostResolution": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "post"
              },
              "post": {
                "$ref": "#/components/schemas/ContentApiPost"
              }
            },
            "required": [
              "kind",
              "post"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "redirect"
              },
              "redirect": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "permanent": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "slug",
                  "url",
                  "permanent"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "redirect"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ContentApiPostSummary": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "slug": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContentApiCategoryRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "slug",
                "name"
              ],
              "additionalProperties": false
            }
          },
          "cover": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ContentApiImage"
              },
              {
                "type": "null"
              }
            ]
          },
          "feeds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "web",
                "app"
              ]
            }
          },
          "readingMinutes": {
            "type": "integer"
          },
          "publishedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "revision": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "slug",
          "locale",
          "title",
          "excerpt",
          "url",
          "category",
          "tags",
          "authors",
          "cover",
          "feeds",
          "readingMinutes",
          "publishedAt",
          "updatedAt",
          "revision"
        ],
        "additionalProperties": false
      },
      "ContentApiSitemap": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slug": {
                  "type": "string"
                },
                "locale": {
                  "type": "string"
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "updatedAt": {
                  "$ref": "#/components/schemas/Timestamp"
                },
                "alternates": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "locale": {
                        "type": "string"
                      },
                      "url": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "locale",
                      "url"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "slug",
                "locale",
                "url",
                "updatedAt",
                "alternates"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "ContentApiTagList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tag": {
                  "type": "string"
                },
                "postCount": {
                  "type": "integer"
                }
              },
              "required": [
                "tag",
                "postCount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "ContentBodyResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number",
            "const": 1
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          }
        },
        "required": [
          "version",
          "blocks"
        ],
        "additionalProperties": false
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "fields": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "details": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "retryAfterSeconds": {
                "type": "integer"
              },
              "traceId": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "traceId"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "Id": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
      },
      "Timestamp": {
        "type": "string",
        "format": "date-time",
        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
      }
    },
    "responses": {
      "ValidationFailed": {
        "description": "İstek doğrulanamadı (`VALIDATION_FAILED`). `error.fields` her hatalı alan için isteğin dilinde mesajları taşır; alan yolu noktayla yazılır (`properties.2.enumValues`), gövdenin bütünü için `_`. Okunamayan JSON `INVALID_REQUEST`, bozuk imleç `CURSOR_INVALID` döner.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "VALIDATION_FAILED",
                "message": "Girilen bilgileri kontrol edin.",
                "fields": {
                  "name": [
                    "Ad gerekli."
                  ]
                },
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Kimlik yok ya da geçersiz: panelde oturum çerezi (`SESSION_REQUIRED`, ikinci adım bekleyen oturumda `TWO_FACTOR_REQUIRED`), Management API'de `Authorization: Bearer mk_…` (`API_KEY_INVALID`: yok, bilinmiyor, iptal edilmiş ya da süresi dolmuş). Giriş uçlarında hatalı bilgiler de 401 döner (`INVALID_CREDENTIALS`, `TOTP_CODE_INVALID`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "API_KEY_INVALID",
                "message": "API anahtarı geçersiz, iptal edilmiş ya da süresi dolmuş.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "Yetki yok: rol gereken izni vermiyor (`PERMISSION_REQUIRED`, `error.details.permissions`), API anahtarının kapsamı eksik (`API_KEY_SCOPE_MISSING`, `error.details.scopes`) ya da organizasyon askıda (`ORGANIZATION_SUSPENDED`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "API_KEY_SCOPE_MISSING",
                "message": "API anahtarının bu işlem için gereken kapsamı yok.",
                "details": {
                  "scopes": [
                    "management:write"
                  ]
                },
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Kayıt bulunamadı ya da çağıranın kapsamında değil; ikisi bilerek ayırt edilmez (ör. `APP_NOT_FOUND`, `EVENT_DEFINITION_NOT_FOUND`). Biçimi geçersiz kimlikler de 404 döner.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "APP_NOT_FOUND",
                "message": "Uygulama bulunamadı veya erişim yetkiniz yok.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "Conflict": {
        "description": "Kaydın güncel durumu bu işleme izin vermiyor ya da aynı kayıt zaten var (ör. `APP_SLUG_TAKEN`, `EVENT_NAME_TAKEN`, `LAST_OWNER`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "EVENT_NAME_TAKEN",
                "message": "\"purchase_completed\" adlı olay zaten tanımlı.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "Gone": {
        "description": "E-postayla gelen bağlantı geçersiz, kullanılmış ya da süresi dolmuş (`LINK_INVALID`, `INVITATION_INVALID`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "LINK_INVALID",
                "message": "Bağlantı geçersiz ya da süresi dolmuş.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "RuleViolation": {
        "description": "İş kuralı ihlali. `error.message` kullanıcıya olduğu gibi gösterilebilir.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "CHECK_VIOLATION",
                "message": "Kayıt kurallara uymuyor.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Çok fazla istek (`TOO_MANY_REQUESTS`, `Retry-After` başlığıyla) ya da hesap geçici olarak kilitli (`ACCOUNT_LOCKED`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "TOO_MANY_REQUESTS",
                "message": "Çok fazla istek gönderildi. Lütfen 30 saniye sonra tekrar deneyin.",
                "retryAfterSeconds": 30,
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      },
      "InternalError": {
        "description": "Beklenmeyen hata (`INTERNAL_ERROR`). Destek talebinde `error.traceId` iletilir.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "INTERNAL_ERROR",
                "message": "Beklenmeyen bir hata oluştu. Sorun sürerse destek ekibine iz numarasını iletin.",
                "traceId": "9b1c4f2e-6a1d-4c55-8f0e-2b7a3d9e5c10"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "mk_…",
        "description": "Organizasyonun API anahtarı (`mk_` + 40 karakter), kapsam `content:read`."
      }
    }
  }
}
