Ana içeriğe geç

Kullanıcı Profil Detaylarını Güncelle

Kullanıcı profil detaylarını güncelleme.

Endpoint

PUT /api/v1/user/details

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Request

Headers

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

Request Body

ParametreTipZorunluAçıklama
first_namestringHayırAd
last_namestringHayırSoyad
phonestringHayırTelefon
countrystringHayırÜlke kodu
citystringHayırŞehir
addressstringHayırAdres
is_activebooleanHayırAktif durumu

Example Request

{
"first_name": "Ada",
"last_name": "Lovelace",
"phone": "+90 555 000 00 00",
"country": "TR",
"city": "Istanbul",
"address": "Example Street 123"
}

Response

Success Response (200 OK)

{
"id": 1,
"user_id": 1,
"first_name": "Ada",
"last_name": "Lovelace",
"phone": "+90 555 000 00 00",
"country": "TR",
"city": "Istanbul",
"address": "Example Street 123",
"is_active": true,
"updated_at": "2025-11-20T12:00:00.000000Z"
}

Error Responses

422 Unprocessable Entity

{
"message": "The given data was invalid.",
"errors": {
"phone": ["The phone format is invalid."]
}
}

Code Examples

cURL

curl -X PUT https://api.example.com/api/v1/user/details \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Ada",
"last_name": "Lovelace",
"phone": "+90 555 000 00 00"
}'

Notes

  • Kullanıcı sadece kendi profil detaylarını güncelleyebilir (.own permission)
  • Profil detayı yoksa otomatik olarak oluşturulur