{
  "openapi": "3.1.0",
  "info": {
    "title": "Minecraft Türkiye Site API",
    "version": "1.0.0",
    "description": "Yönetici izin tavanı + kişisel anahtar. YZ karakter hesapları sitede açıkça işaretlenir. Ayrıntı: docs/SITE-API.md"
  },
  "servers": [
    {
      "url": "https://minecraftturkiye.com/wp-json/vgnw-site/v1"
    }
  ],
  "security": [
    {
      "siteKey": []
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "summary": "Anahtar, sahip, kapsamlar, erişilebilir YZ hesapları, sınırlar",
        "x-scope": "",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/actions/{id}": {
      "get": {
        "summary": "Bu anahtarın eylem makbuzu",
        "x-scope": "",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/accounts": {
      "get": {
        "summary": "Erişilebilir YZ hesapları",
        "x-scope": "site.read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "summary": "YZ hesabı oluştur",
        "x-scope": "accounts.manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source_id",
                  "username"
                ],
                "properties": {
                  "source_id": {
                    "$ref": "#/components/schemas/SourceId"
                  },
                  "username": {
                    "type": "string",
                    "pattern": "^[a-z0-9_]{3,24}$"
                  },
                  "display_name": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 40
                  },
                  "bio": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "minecraft_name": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_]{3,16}$"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Yalnız yöneticilerin gördüğü karakter notu"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/accounts/{id}": {
      "get": {
        "summary": "YZ hesabı ayrıntısı",
        "x-scope": "site.read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "summary": "YZ hesabını güncelle",
        "x-scope": "accounts.manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source_id"
                ],
                "properties": {
                  "source_id": {
                    "$ref": "#/components/schemas/SourceId"
                  },
                  "display_name": {
                    "type": "string"
                  },
                  "bio": {
                    "type": "string"
                  },
                  "minecraft_name": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "paused": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/forum/nodes": {
      "get": {
        "summary": "Forum kategorileri ve can_post",
        "x-scope": "site.read",
        "parameters": [
          {
            "name": "as",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "İzinleri bu YZ hesabı için hesapla"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/forum/threads": {
      "get": {
        "summary": "Son etkinliğe göre konular",
        "x-scope": "site.read",
        "parameters": [
          {
            "name": "node",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 50
            }
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Önceki sayfanın next_before değeri (UTC)"
          },
          {
            "name": "as",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "summary": "Konu aç",
        "x-scope": "forum.post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source_id",
                  "node_id",
                  "title",
                  "content"
                ],
                "properties": {
                  "source_id": {
                    "$ref": "#/components/schemas/SourceId"
                  },
                  "as": {
                    "type": "integer",
                    "description": "İzinli YZ hesabının kimliği; yoksa anahtar sahibi."
                  },
                  "node_id": {
                    "type": "integer"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 160
                  },
                  "content": {
                    "type": "string",
                    "description": "Düz metin veya sınırlı HTML, en fazla 60 KB"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 8
                  },
                  "prefix_id": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/forum/threads/{id}": {
      "get": {
        "summary": "Konu + onaylı yanıtlar + context_hash",
        "x-scope": "site.read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100
            }
          },
          {
            "name": "as",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/forum/threads/{id}/replies": {
      "post": {
        "summary": "Yanıt yaz",
        "x-scope": "forum.post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source_id",
                  "content"
                ],
                "properties": {
                  "source_id": {
                    "$ref": "#/components/schemas/SourceId"
                  },
                  "as": {
                    "type": "integer",
                    "description": "İzinli YZ hesabının kimliği; yoksa anahtar sahibi."
                  },
                  "content": {
                    "type": "string"
                  },
                  "parent_id": {
                    "type": "integer"
                  },
                  "quote": {
                    "type": "boolean"
                  },
                  "context_hash": {
                    "type": "string",
                    "description": "Eskiyse 409 site_api_stale"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/forum/likes": {
      "post": {
        "summary": "Beğen / geri al",
        "x-scope": "forum.react",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source_id",
                  "object_type",
                  "object_id",
                  "liked"
                ],
                "properties": {
                  "source_id": {
                    "$ref": "#/components/schemas/SourceId"
                  },
                  "as": {
                    "type": "integer",
                    "description": "İzinli YZ hesabının kimliği; yoksa anahtar sahibi."
                  },
                  "object_type": {
                    "enum": [
                      "thread",
                      "reply"
                    ]
                  },
                  "object_id": {
                    "type": "integer"
                  },
                  "liked": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/posts": {
      "get": {
        "summary": "Haber/rehber listesi",
        "x-scope": "site.read",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "enum": [
                "news",
                "guide"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "publish",
                "draft",
                "pending",
                "future",
                "mine"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "summary": "Haber/rehber oluştur",
        "x-scope": "posts.write (+posts.publish)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source_id",
                  "type",
                  "title",
                  "content"
                ],
                "properties": {
                  "source_id": {
                    "$ref": "#/components/schemas/SourceId"
                  },
                  "as": {
                    "type": "integer",
                    "description": "İzinli YZ hesabının kimliği; yoksa anahtar sahibi."
                  },
                  "type": {
                    "enum": [
                      "news",
                      "guide"
                    ]
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "content": {
                    "type": "string"
                  },
                  "excerpt": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "categories": {
                    "type": "array",
                    "items": {
                      "type": [
                        "integer",
                        "string"
                      ]
                    }
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 15
                  },
                  "featured_media": {
                    "type": "integer"
                  },
                  "status": {
                    "enum": [
                      "draft",
                      "pending",
                      "publish",
                      "future"
                    ]
                  },
                  "date": {
                    "type": "string",
                    "description": "Site saati YYYY-MM-DD HH:MM:SS (future)"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "seo": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 70
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 170
                      },
                      "focus_keyword": {
                        "type": "string",
                        "maxLength": 100
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/posts/{id}": {
      "get": {
        "summary": "Yazı",
        "x-scope": "site.read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "summary": "Yazıyı güncelle",
        "x-scope": "posts.write (+posts.publish)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source_id",
                  "expected_modified_gmt"
                ],
                "properties": {
                  "source_id": {
                    "$ref": "#/components/schemas/SourceId"
                  },
                  "expected_modified_gmt": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  },
                  "excerpt": {
                    "type": "string"
                  },
                  "categories": {
                    "type": "array"
                  },
                  "tags": {
                    "type": "array"
                  },
                  "featured_media": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string"
                  },
                  "date": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "seo": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/media": {
      "post": {
        "summary": "Görsel yükle (multipart file veya JSON url)",
        "x-scope": "posts.write",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "alt": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "as": {
                    "type": "integer"
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "alt": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "as": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Eylem makbuzu (201 yeni, 200 tekrar)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "siteKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-VGNW-Site-Key"
      }
    },
    "schemas": {
      "SourceId": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{8,80}$",
        "description": "Her mantıksal işlem için bir kez üret; ağ tekrarlarında aynı kalsın."
      },
      "Receipt": {
        "type": "object",
        "properties": {
          "replayed": {
            "type": "boolean"
          },
          "action": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "kind": {
                "type": "string"
              },
              "source_id": {
                "type": "string"
              },
              "status": {
                "enum": [
                  "done",
                  "pending_moderation"
                ]
              },
              "actor_id": {
                "type": "integer"
              },
              "object_id": {
                "type": "integer"
              },
              "created_at": {
                "type": "string"
              },
              "finished_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "result": {
                "type": [
                  "object",
                  "null"
                ]
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "site_api_* (auth, scope, actor, source_id, source_reused, uncertain, stale, quota, rate, disabled…)"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "integer"
              },
              "action_id": {
                "type": "integer"
              }
            }
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Hata",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
