{
  "openapi": "3.1.0",
  "info": {
    "title": "Poycord API",
    "version": "1.0.0",
    "description": "Poycord backend REST API — bot ve dış entegrasyonlar için. Kimlik: Authorization: Bearer poy_live_..."
  },
  "servers": [
    { "url": "https://poycord.duckdns.org/api/v1", "description": "Sürümlü kök (botlar)" }
  ],
  "security": [{ "bearerAuth": [] }],
  "components": {
    "securitySchemes": {
      "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "poy_live" }
    },
    "parameters": {
      "userId": { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Discord kullanıcı ID" },
      "guildId": { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Discord sunucu ID" }
    },
    "responses": {
      "Unauthorized": { "description": "Anahtar geçersiz/kapalı/süresi dolmuş" },
      "Forbidden": { "description": "Yetersiz seviye veya yasak yüzey" },
      "RateLimited": { "description": "Hız limiti (120/dk)" }
    }
  },
  "paths": {
    "/me": { "get": { "summary": "Anahtar/oturum bilgisi", "tags": ["Kimlik"], "responses": { "200": { "description": "OK" } } } },
    "/search": {
      "get": {
        "summary": "Kullanıcı ara", "tags": ["Kullanıcı"],
        "parameters": [{ "name": "q", "in": "query", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Kullanıcı listesi" }, "401": { "$ref": "#/components/responses/Unauthorized" } }
      }
    },
    "/user/{id}": { "get": { "summary": "Kullanıcı profili", "tags": ["Kullanıcı"], "parameters": [{ "$ref": "#/components/parameters/userId" }], "responses": { "200": { "description": "OK" }, "401": { "$ref": "#/components/responses/Unauthorized" } } } },
    "/user/{id}/stats": { "get": { "summary": "Mesaj/ses istatistikleri", "tags": ["Kullanıcı"], "parameters": [{ "$ref": "#/components/parameters/userId" }], "responses": { "200": { "description": "OK" } } } },
    "/user/{id}/presence": { "get": { "summary": "Durum/son görülme", "tags": ["Kullanıcı"], "parameters": [{ "$ref": "#/components/parameters/userId" }], "responses": { "200": { "description": "OK" } } } },
    "/user/{id}/devices": { "get": { "summary": "Cihaz kullanımı", "tags": ["Kullanıcı"], "parameters": [{ "$ref": "#/components/parameters/userId" }], "responses": { "200": { "description": "OK" } } } },
    "/user/{id}/network": { "get": { "summary": "Sosyal ağ", "tags": ["Kullanıcı"], "parameters": [{ "$ref": "#/components/parameters/userId" }], "responses": { "200": { "description": "OK" } } } },
    "/user/{id}/wrapped": { "get": { "summary": "Yıllık özet", "tags": ["Kullanıcı"], "parameters": [{ "$ref": "#/components/parameters/userId" }], "responses": { "200": { "description": "OK" } } } },
    "/user/{id}/deep": { "get": { "summary": "Derin sorgu (Tam seviye)", "tags": ["Kullanıcı"], "parameters": [{ "$ref": "#/components/parameters/userId" }], "responses": { "200": { "description": "OK" }, "403": { "$ref": "#/components/responses/Forbidden" } } } },
    "/guild/{id}": { "get": { "summary": "Sunucu özeti", "tags": ["Sunucu"], "parameters": [{ "$ref": "#/components/parameters/guildId" }], "responses": { "200": { "description": "OK" } } } },
    "/guild/{id}/members": { "get": { "summary": "Üyeler", "tags": ["Sunucu"], "parameters": [{ "$ref": "#/components/parameters/guildId" }], "responses": { "200": { "description": "OK" } } } },
    "/guild/{id}/channels": { "get": { "summary": "Kanallar", "tags": ["Sunucu"], "parameters": [{ "$ref": "#/components/parameters/guildId" }], "responses": { "200": { "description": "OK" } } } },
    "/guild/{id}/roles": { "get": { "summary": "Roller", "tags": ["Sunucu"], "parameters": [{ "$ref": "#/components/parameters/guildId" }], "responses": { "200": { "description": "OK" } } } },
    "/users": { "get": { "summary": "Tüm kullanıcılar", "tags": ["Toplu"], "responses": { "200": { "description": "OK" } } } },
    "/guilds": { "get": { "summary": "Tüm sunucular", "tags": ["Toplu"], "responses": { "200": { "description": "OK" } } } },
    "/ranking/messages": { "get": { "summary": "Mesaj sıralaması", "tags": ["Sıralama"], "responses": { "200": { "description": "OK" } } } },
    "/ranking/voice": { "get": { "summary": "Ses sıralaması", "tags": ["Sıralama"], "responses": { "200": { "description": "OK" } } } },
    "/db/stats": { "get": { "summary": "Veritabanı özeti", "tags": ["Toplu"], "responses": { "200": { "description": "OK" } } } },
    "/watchlist": {
      "get": { "summary": "Takip listesi (Tam seviye)", "tags": ["Takip"], "responses": { "200": { "description": "OK" }, "403": { "$ref": "#/components/responses/Forbidden" } } },
      "post": { "summary": "Takibe ekle (Tam seviye)", "tags": ["Takip"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "userId": { "type": "string" }, "label": { "type": "string" } }, "required": ["userId"] } } } }, "responses": { "200": { "description": "OK" }, "403": { "$ref": "#/components/responses/Forbidden" } } }
    }
  },
  "tags": [
    { "name": "Kimlik" }, { "name": "Kullanıcı" }, { "name": "Sunucu" },
    { "name": "Toplu" }, { "name": "Sıralama" }, { "name": "Takip" }
  ]
}
