Skip to main content

Kullanıcı Güncelle

Kullanıcı bilgilerini günceller.

Endpoint

PUT /api/v1/users/\{uuid\}
PATCH /api/v1/users/\{uuid\}

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • users.update - Tüm kullanıcıları güncelleme
  • users.update.own - Sadece kendi profilini güncelleme

Request

Headers

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

Path Parameters

ParametreTipZorunluAçıklama
uuidstringEvetKullanıcı UUID'si

Request Body

ParametreTipZorunluAçıklama
emailstringHayırE-posta adresi
passwordstringHayırŞifre
is_activebooleanHayırAktif durumu
role_idsarrayHayırRol ID'leri

Example Request

{
"email": "member+updated@example.com",
"is_active": true,
"role_ids": [2, 3]
}

Response

Success Response (200 OK)

{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"email": "member+updated@example.com",
"is_active": true,
"updated_at": "2025-11-20T12:00:00.000000Z"
}

Code Examples

cURL

curl -X PATCH https://api.example.com/api/v1/users/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"email": "member+updated@example.com",
"is_active": true
}'

Notes

  • .own permission'ı olan kullanıcılar sadece kendi profilini güncelleyebilir
  • PUT tüm alanları günceller, PATCH sadece gönderilen alanları günceller