{"openapi":"3.1.0","info":{"title":"EU-Bridge API","version":"1.0.0","description":"AB proje başvurusu hazırlama platformunun genel API'si. Projeler, dört analiz, uzman talepleri, kullanıcı hiyerarşisi ve Word/Excel/PDF çıktı üretimi."},"servers":[{"url":"/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API anahtarı. «Paket ve ödeme → API anahtarları» ekranından üretilir ve yalnızca üretildiği anda bir kez gösterilir."}},"schemas":{"Hata":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}},"Proje":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"acronym":{"type":["string","null"]},"organization":{"type":["string","null"]},"status":{"type":"string","enum":["DRAFT","IN_PROGRESS","COMPLETED","ARCHIVED"]},"current_step":{"type":"integer"},"progress_pct":{"type":"integer"},"duration_months":{"type":"integer"}}},"Paydas":{"type":"object","required":["name","role","influence"],"properties":{"name":{"type":"string"},"role":{"type":"string","enum":["BENEFICIARY","DECISION_MAKER","IMPLEMENTER","FUNDER","OPPONENT","OTHER"]},"influence":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"contribution":{"type":["string","null"]},"expectation":{"type":["string","null"]}}},"AgacDugumu":{"type":"object","required":["kind","text"],"properties":{"kind":{"type":"string","enum":["CAUSE","EFFECT","MEAN","END"]},"text":{"type":"string"}}}},"responses":{"Yetkisiz":{"description":"Anahtar eksik, tanınmadı ya da süresi dolmuş","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hata"}}}},"YetkiYetersiz":{"description":"Anahtarın bu işlem için yetkisi (scope) yok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hata"}}}},"SinirAsildi":{"description":"Saatlik istek sınırı aşıldı","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hata"}}}}}},"paths":{"/cagri-tipleri":{"get":{"summary":"Çağrı tipleri ve başvuru formu şemaları","security":[{"bearerAuth":["projects:read"]}],"parameters":[{"name":"form","in":"query","schema":{"type":"string","enum":["1"]},"description":"1 verilirse form bölümleri ve alanları da döner"}],"responses":{"200":{"description":"Liste"},"401":{"$ref":"#/components/responses/Yetkisiz"},"429":{"$ref":"#/components/responses/SinirAsildi"}}}},"/projeler":{"get":{"summary":"Projeleri listele","security":[{"bearerAuth":["projects:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":25,"maximum":100}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Sayfalanmış proje listesi"},"401":{"$ref":"#/components/responses/Yetkisiz"}}},"post":{"summary":"Yeni proje oluştur","security":[{"bearerAuth":["projects:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","call_type_code"],"properties":{"title":{"type":"string","minLength":3},"call_type_code":{"type":"string","description":"GET /cagri-tipleri ile alınır (ör. ria)"},"acronym":{"type":"string"},"organization":{"type":"string"},"duration_months":{"type":"integer","minimum":1,"maximum":120}}}}}},"responses":{"201":{"description":"Oluşturuldu"},"403":{"description":"Paket kotası dolu"},"422":{"description":"Doğrulama hatası"}}}},"/projeler/{id}":{"get":{"summary":"Projenin tüm atölye verisi","security":[{"bearerAuth":["projects:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Proje + analizler + logframe + bütçe"},"404":{"description":"Bulunamadı ya da erişim yok"}}},"patch":{"summary":"Künye alanlarını güncelle","security":[{"bearerAuth":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proje"}}}},"responses":{"200":{"description":"Güncellendi"}}}},"/projeler/{id}/analiz/{tur}":{"get":{"summary":"Analizi oku","security":[{"bearerAuth":["projects:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"tur","in":"path","required":true,"schema":{"type":"string","enum":["paydas","sorun-agaci","hedef-agaci","surdurulebilirlik"]}}],"responses":{"200":{"description":"Analiz kayıtları"}}},"put":{"summary":"Analizin tamamını değiştir (idempotent)","security":[{"bearerAuth":["projects:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"tur","in":"path","required":true,"schema":{"type":"string","enum":["paydas","sorun-agaci","hedef-agaci","surdurulebilirlik"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Paydas"}},{"type":"array","items":{"$ref":"#/components/schemas/AgacDugumu"}}]}}}},"responses":{"200":{"description":"Kaydedildi"}}}},"/projeler/{id}/disa-aktar":{"post":{"summary":"Word / Excel / PDF üret","security":[{"bearerAuth":["exports:create"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"bicim","in":"query","schema":{"type":"string","enum":["docx","xlsx","pdf"],"default":"docx"}}],"responses":{"200":{"description":"Belge (ikili gövde)","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}}}}},"/kullanicilar":{"get":{"summary":"Alt ağaçtaki hesaplar","security":[{"bearerAuth":["users:read"]}],"responses":{"200":{"description":"Kullanıcı listesi"}}},"post":{"summary":"Alt hesap aç","security":[{"bearerAuth":["users:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["full_name","email","password"],"properties":{"full_name":{"type":"string"},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8},"phone":{"type":"string"},"organization":{"type":"string"},"role":{"type":"string","enum":["ADMIN","EXPERT","USER"]}}}}}},"responses":{"201":{"description":"Hesap açıldı"},"403":{"description":"Koltuk kotası dolu ya da yetki yok"},"409":{"description":"E-posta zaten kayıtlı"}}}},"/uzman-talepleri":{"get":{"summary":"Uzman taleplerini listele","security":[{"bearerAuth":["projects:read"]}],"responses":{"200":{"description":"Talep listesi"}}},"post":{"summary":"Uzman talebi aç","security":[{"bearerAuth":["projects:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["full_name","phone","message"],"properties":{"full_name":{"type":"string"},"phone":{"type":"string","pattern":"^0?5\\d{9}$"},"message":{"type":"string","minLength":10},"project_id":{"type":"string","format":"uuid"}}}}}},"responses":{"201":{"description":"Talep açıldı"},"409":{"description":"Zaten açık talep var"}}}}}}