Kullanıcı Ayarlarını Güncelle
Kullanıcı ayarlarını günceller.
Endpoint
PUT /api/v1/user/settings
PATCH /api/v1/user/settings
Authentication
Bu endpoint authentication gerektirir.
Header: Authorization: Bearer \{token\}
Permission
user.settings.update- Tüm kullanıcı ayarlarını güncellemeuser.settings.update.own- Sadece kendi ayarlarını güncelleme
Request
Headers
| Header | Değer | Zorunlu |
|---|---|---|
Authorization | Bearer \{token\} | Evet |
Content-Type | application/json | Evet |
Request Body
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
locale | string | Hayır | Dil kodu (tr, en, de, vb.) |
timezone | string | Hayır | Saat dilimi (Europe/Istanbul, vb.) |
date_format | string | Hayır | Tarih formatı (d/m/Y, Y-m-d, vb.) |
time_format | string | Hayır | Saat formatı (H:i, h:i A, vb.) |
currency_id | integer | Hayır | Para birimi ID'si |
country_code | string | Hayır | Ülke kodu |
theme | string | Hayır | Tema (light, dark) |
items_per_page | integer | Hayır | Sayfa başına kayıt sayısı |
custom_settings | object | Hayır | Özel ayarlar (JSON) |
notifications_email | boolean | Hayır | E-posta bildirimleri |
notifications_sms | boolean | Hayır | SMS bildirimleri |
notifications_push | boolean | Hayır | Push bildirimleri |
Example Request
{
"locale": "tr",
"timezone": "Europe/Istanbul",
"date_format": "d/m/Y",
"time_format": "H:i",
"currency_id": 1,
"country_code": "TR",
"theme": "dark",
"items_per_page": 20
}
Response
Success Response (200 OK)
Güncellenmiş ayar kaydı döner.
Code Examples
cURL
curl -X PUT https://api.example.com/api/v1/user/settings \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"locale": "tr",
"timezone": "Europe/Istanbul",
"date_format": "d/m/Y",
"time_format": "H:i"
}'
Notes
- Ayarlar yoksa otomatik olarak oluşturulur
- Güncelleme sonrası
SetUserLocalemiddleware'i yeni ayarları uygular
Related Endpoints
- Get Settings - Ayarları getir