Tenant Yetkilendirme
Tenant kullanıcı girişi, şifre değiştirme ve profil güncelleme.
Base URL: /api/tenant/auth
Yetkilendirme: Bearer Token + X-Api-Key (belirtilen hariç)
ipucu
Login response'u aktif modulleri donmez. Aktif modulleri almak icin Tenant Moduller endpoint'ini kullanin.
POST /login
Tenant kullanıcı girişi yapar.
not
Bu endpoint yalnızca X-Api-Key header'ı gerektirir, JWT token gerekmez.
Headers:
X-Api-Key: customer-api-key
Request Body:
{
"email": "user@example.com",
"password": "string"
}
Response — 200 OK:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"expiresAt": "2026-03-28T12:00:00Z"
}
}
PUT /change-password
Kullanıcı şifresini değiştirir.
Headers:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
X-Api-Key: customer-api-key
Request Body:
{
"currentPassword": "old-password",
"newPassword": "new-password"
}
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
currentPassword | string | Evet | Mevcut şifre |
newPassword | string | Evet | Yeni şifre |
Response — 200 OK:
{
"success": true,
"message": "Şifre başarıyla değiştirildi."
}
PUT /profile
Kullanıcı profil bilgilerini günceller.
Headers:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
X-Api-Key: customer-api-key
Request Body:
{
"fullName": "Ali Yılmaz",
"email": "ali@example.com"
}
| Alan | Tip | Zorunlu | Açıklama |
|---|---|---|---|
fullName | string | Evet | Ad soyad |
email | string | Evet | E-posta adresi |
Response — 200 OK:
{
"success": true,
"data": {
"id": "3fa85f64-...",
"email": "ali@example.com",
"fullName": "Ali Yılmaz",
"isActive": true,
"createdAt": "2026-03-27T10:00:00Z"
}
}
Olası Hatalar
| Kod | Durum |
|---|---|
401 | Token eksik veya geçersiz |
403 | Token ile X-Api-Key eslesmiyor veya tenant kullanicisi yetkisi yok |
404 | Kullanıcı bulunamadı |
409 | Profil guncellemede email zaten kullanımda |
400 | Mevcut sifre hatali veya request body gecersiz |