API Dokümantasyon
REST API ile 273 sözleşme şablonu, 315 hesaplama aracı ve AI sözleşme analizine erişin.
1. Authentication
Tüm API istekleri Authorization: Bearer scp_YOUR_KEY header'ı gerektirir. Key oluşturmak için Hesabım → API Anahtarlarım sayfasına gidin.
curl https://sozlesmecepte.com/api/v1/templates \ -H "Authorization: Bearer scp_YOUR_KEY"
2. Endpoints
/api/v1/templatesŞablonları Listele
273 aktif sözleşme şablonu (kira, iş, NDA, hizmet, ortaklık vb.)
Query parametreleri:
category— Kategori filtresi (örn. 'kira', 'is')limit— Max 200, default 50offset— Pagination offset
{
"data": [
{
"slug": "konut-kira-sozlesmesi",
"name": "Konut Kira Sözleşmesi",
"category": "Kira & Gayrimenkul",
"estimated_minutes": 5,
"question_count": 12,
"version": "2.1",
"url": "https://sozlesmecepte.com/sozlesmeler/konut-kira-sozlesmesi"
}
// ... 200+ daha
],
"meta": { "total": 273, "limit": 50, "offset": 0 }
}/api/v1/templates/{slug}Şablon Detayı
Şablonun tüm alanları, soru listesi, placeholder mapping. Bu detayla form oluşturup kullanıcıdan input alabilirsiniz.
{
"slug": "konut-kira-sozlesmesi",
"name": "Konut Kira Sözleşmesi",
"questions": [...],
"placeholders": {...},
"create_url": "https://sozlesmecepte.com/sozlesmeler/konut-kira-sozlesmesi/olustur"
}/api/v1/calculationsHesaplama Araçlarını Listele
315 aktif hesaplama aracı (kıdem, ihbar, faiz, KDV, miras, vb.)
Query parametreleri:
category— Kategori filtresilimit— Max 500
/api/v1/calculations/{slug}Hesaplama Aracı Detayı
Aracın input/output şeması — hangi alanlar zorunlu, format ne, kategori ne
/api/v1/calculations/{slug}/computeHesaplama Yap
Input gönder, sonucu al. Formula sunucuda güvenli sandbox'ta çalışır.
# Request
POST /api/v1/calculations/kidem-tazminati/compute
{
"inputs": {
"son_brut_maas": 35000,
"ise_baslangic": "2020-01-15",
"is_son": "2026-05-19"
}
}
# Response
{
"slug": "kidem-tazminati",
"tool": "Kıdem Tazminatı Hesaplayıcı",
"result": {
"kidem_tutar": 67421.50,
"hizmet_yili": 6.34,
"tavan_uygulandi": false
}
}3. Rate Limits
| Tier | Per minute | Per day | Fiyat |
|---|---|---|---|
| Free | 60 | 1.000 | Ücretsiz |
| Startup | 600 | 25.000 | 499 TL/ay |
| Growth | 3.000 | 200.000 | 1.999 TL/ay |
| Enterprise | ∞ | ∞ | İletişim |
Rate limit aşımında HTTP 429 + X-RateLimit-Limit-Minute header döner.
4. Hata Kodları
{
"error": {
"code": "missing_api_key",
"message": "Authorization: Bearer scp_... header gerekli"
}
}401 missing_api_key / invalid_api_key— Key yok veya yanlış401 revoked_api_key / expired_api_key— Key iptal/sürmüş403 insufficient_scope— Write endpoint için read-only key429 rate_limit_minute / rate_limit_day— Limit aşıldı422 compute_error— Hesaplama input hatası404 not_found— Kaynak yok500 internal_error— Sunucu hatası
5. Interactive API Explorer
Aşağıdaki Swagger UI ile API'yi tarayıcıdan deneyebilirsin. "Authorize" → key gir → "Try it out".
OpenAPI 3.1 spec: openapi.yaml · Postman'a import için spec URL'i kullan: https://sozlesmecepte.com/openapi.yaml
