Ana içeriğe geç

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"
}
AlanTipZorunluAçıklama
currentPasswordstringEvetMevcut şifre
newPasswordstringEvetYeni ş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"
}
AlanTipZorunluAçıklama
fullNamestringEvetAd soyad
emailstringEvetE-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

KodDurum
401Token eksik veya geçersiz
403Token ile X-Api-Key eslesmiyor veya tenant kullanicisi yetkisi yok
404Kullanıcı bulunamadı
409Profil guncellemede email zaten kullanımda
400Mevcut sifre hatali veya request body gecersiz