{
    "openapi": "3.0.3",
    "info": {
        "title": "Şikayet.tc REST API v1",
        "version": "1.0.0",
        "description": "Tüketici deneyimi verilerine programatik erişim. Anahtar yönetimi: Marka Paneli → API Anahtarları."
    },
    "servers": [
        {
            "url": "https://www.sikayet.tc"
        }
    ],
    "components": {
        "securitySchemes": {
            "ApiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            }
        }
    },
    "paths": {
        "/api/v1/markalar": {
            "get": {
                "summary": "Onaylı markaların listesi (skorlar dahil, en fazla 500 kayıt)",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/v1/marka/{slug}": {
            "get": {
                "summary": "Tek markanın detayı + aylık metrikleri",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/v1/sikayetler": {
            "get": {
                "summary": "Şikayet listesi (sayfalı)",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ],
                "parameters": [
                    {
                        "name": "sayfa",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "sayfa=2"
                    },
                    {
                        "name": "adet",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "adet=20"
                    },
                    {
                        "name": "marka",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "marka=slug"
                    },
                    {
                        "name": "kategori",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "kategori=slug"
                    }
                ]
            }
        },
        "/api/v1/sikayet/{id}": {
            "get": {
                "summary": "Tek şikayetin kamu görünümü",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/v1/kategoriler": {
            "get": {
                "summary": "Aktif kategoriler",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/v1/istatistik": {
            "get": {
                "summary": "Platform geneli toplam istatistikler",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/v1/gundem": {
            "get": {
                "summary": "24 saatlik yükselen konular (nabiz)",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/v1/olaylar": {
            "get": {
                "summary": "Anonim olay akışı (kümelenmiş dosyalar)",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/v1/endeks": {
            "get": {
                "summary": "Aylık sektör endeksi",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/test": {
            "post": {
                "summary": "Canlı test isteği — anahtar kimliğini ve örnek yanıtı döner (M-4 portal konsolu)",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/crm/{brandId}/{key}": {
            "post": {
                "summary": "Marka CRM girişi (marka panelinden alınan özel anahtar)",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ],
                "parameters": [
                    {
                        "name": "gövde: {\"ref\":\"CV-123\",\"status\":\"...\",\"note\":\"...\"}",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "gövde: {\"ref\":\"CV-123\",\"status\":\"...\",\"note\":\"...\"}"
                    }
                ]
            }
        },
        "/api/app-config": {
            "get": {
                "summary": "Mobil uygulama uzak yapılandırması (anahtar gerektirmez)",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ]
            }
        },
        "/api/device/register": {
            "post": {
                "summary": "FCM cihaz token kaydı (oturum zorunlu, CSRF hariç)",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz veya eksik API anahtarı"
                    },
                    "429": {
                        "description": "Hız sınırı aşıldı"
                    }
                },
                "security": [
                    {
                        "ApiKeyHeader": []
                    }
                ],
                "parameters": [
                    {
                        "name": "gövde: {\"token\":\"fcm-token\",\"platform\":\"android\"}",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "gövde: {\"token\":\"fcm-token\",\"platform\":\"android\"}"
                    }
                ]
            }
        }
    }
}