Skip to main content

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üncelleme
  • user.settings.update.own - Sadece kendi ayarlarını güncelleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet
Content-Typeapplication/jsonEvet

Request Body

ParametreTipZorunluAçıklama
localestringHayırDil kodu (tr, en, de, vb.)
timezonestringHayırSaat dilimi (Europe/Istanbul, vb.)
date_formatstringHayırTarih formatı (d/m/Y, Y-m-d, vb.)
time_formatstringHayırSaat formatı (H:i, h:i A, vb.)
currency_idintegerHayırPara birimi ID'si
country_codestringHayırÜlke kodu
themestringHayırTema (light, dark)
items_per_pageintegerHayırSayfa başına kayıt sayısı
custom_settingsobjectHayırÖzel ayarlar (JSON)
notifications_emailbooleanHayırE-posta bildirimleri
notifications_smsbooleanHayırSMS bildirimleri
notifications_pushbooleanHayırPush 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ı SetUserLocale middleware'i yeni ayarları uygular