> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.iklim.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Kullanıcı Güncelleme İşlemi

> Sadece ADMIN Rolüne Sahip Kullanıcıların Rol, Durum ve Şifre Güncelleyebildiği, Sadece POWER_USER ve Daha Üst Role Sahip Kullanıcılar ile İstekte Bulunan Kendi Kullanıcının Kullanıcı Adını Değiştirebildiği, Diğer Kullanıcı Rollerine Sahip Kullanıcıların Kalan Diğer Alanları Güncelleyebildiği Bir İşlemdir.



## OpenAPI

````yaml /open-api/tr/auth-version-1.json patch /v1/users/update
openapi: 3.0.1
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://api.iklim.co
    description: Production server
  - url: https://api-test.iklim.co
    description: Test server
  - url: http://localhost:8080
    description: Local development environment with api gateway
security: []
tags:
  - name: Kullanıcı Servisi
    description: Kullanıcı ile İlgili İşlemleri Yönetir
  - name: Yetklilendirme Servisi
    description: Yetkilendirme İşlemlerini Yönetir
paths:
  /v1/users/update:
    patch:
      tags:
        - Kullanıcı Servisi
      summary: Kullanıcı Güncelleme İşlemi
      description: >-
        Sadece ADMIN Rolüne Sahip Kullanıcıların Rol, Durum ve Şifre
        Güncelleyebildiği, Sadece POWER_USER ve Daha Üst Role Sahip Kullanıcılar
        ile İstekte Bulunan Kendi Kullanıcının Kullanıcı Adını Değiştirebildiği,
        Diğer Kullanıcı Rollerine Sahip Kullanıcıların Kalan Diğer Alanları
        Güncelleyebildiği Bir İşlemdir.
      operationId: update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserRequest'
        required: true
      responses:
        '200':
          description: Başarılı Kullanıcı Güncelleme
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '400':
          description: >-
            İstek Sırasında Gerekli Başlıklar Bulunamadı veya İstek Gövdesi
            Hatalı
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Bad Request Example:
                  summary: Example response
                  description: Bad Request Example
                  value:
                    timestamp: '2025-04-14T16:26:54.203118461'
                    status: 400
                    error: Bad Request
                    message: Missing X-Idempotency-Key header
                    path: /endpoint/uri/here
        '401':
          description: Yetkisiz veya Hatalı İmza ile İstek
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Unauthorized Example 1:
                  summary: Example response 1
                  description: Unauthorized Example 1
                  value:
                    timestamp: '2025-04-14T16:57:50.083970026'
                    status: 401
                    error: Unauthorized
                    message: Bad Credentials
                    path: /endpoint/uri/here
                Unauthorized Example 2:
                  summary: Example response 2
                  description: Unauthorized Example 2
                  value:
                    timestamp: '2025-04-14T16:57:50.083970026'
                    status: 401
                    error: Unauthorized
                    message: Invalid request signature
                    path: /auth/login
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '409':
          description: Mükerrer İstek Yapıldı
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Conflict Example 1:
                  summary: Example response 1
                  description: Conflict Example 1
                  value:
                    timestamp: '2025-04-14T16:57:21.168927321'
                    status: 409
                    error: Conflict
                    message: Replay attack detected (nonce reused)
                    path: /endpoint/uri/here
                Conflict Example 2:
                  summary: Example response 2
                  description: Conflict Example 2
                  value:
                    timestamp: '2025-04-14T16:56:28.671809875'
                    status: 409
                    error: Conflict
                    message: Duplicate request detected (X-Idempotency-Key)
                    path: /endpoint/uri/here
        '500':
          description: İstek Sırasında Dahili Sunucu Hatası
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Internal Server Error Example:
                  summary: Example response
                  description: Internal Server Error Example
                  value:
                    timestamp: '2025-04-14T16:58:10.414972912'
                    status: 500
                    error: Internal Server Error
                    message: An Error Occurred During Login
                    path: /endpoint/uri/here
components:
  schemas:
    UpdateUserRequest:
      required:
        - userId
      type: object
      properties:
        userId:
          type: string
          description: Güncellenen Kullanıcının Kimlik Belirteci
          example: 88a52d74-ebee-49a4-9631-cfe492f4bf53
        username:
          type: string
          description: >-
            Yeni Kullanıcının Adı. Bu Alanı Kullanıcının Kendisi veya POWER_USER
            Yetkisine Sahip Kullanıcılar Güncelleyebilir!
          example: newuser@domain.com
        password:
          type: string
          description: >-
            Kullanıcının Yeni Şifresi. Bu Alanı Sadece ADMIN Yetkisine Sahip
            Kullanıcılar Güncelleyebilir!
          example: newStr0ng!P@ssw0rd
        firstName:
          type: string
          description: Kullanıcının Yeni İlk Adı
        midName:
          type: string
          description: Kullanıcının Yeni Göbek Adı
        lastName:
          type: string
          description: Kullanıcının Yeni Soyadı
        locale:
          type: string
          description: Kullanıcının Yeni Yerel Ayarları
          example: tr_TR
        timezone:
          type: string
          description: Kullanıcının Yeni Zaman Dilimi
          example: Europe/Istanbul
        roles:
          type: array
          description: >-
            Kullanıcının Yeni Rolleri. Bu Alanı Sadece ADMIN Yetkisine Sahip
            Kullanıcılar Güncelleyebilir!
          example: '[''API_USER'']'
          items:
            type: string
            description: '{msg:swagger.schema.users.update.roles}'
            example: '[''API_USER'']'
            enum:
              - GUEST
              - API_USER
              - STANDARD_USER
              - POWER_USER
              - EXTENDED_USER
              - ADMIN
        status:
          type: string
          description: >-
            Kullanıcının Yeni Durumu. Bu Alanı Sadece ADMIN Yetkisine Sahip
            Kullanıcılar Güncelleyebilir!
          example: INACTIVE
          enum:
            - INACTIVE
            - ACTIVE
            - EXPIRED
            - BLOCKED
            - DELETED
        empty:
          type: boolean
    UserResponse:
      required:
        - firstName
        - lastName
        - locale
        - roles
        - status
        - timezone
        - userId
        - username
      type: object
      properties:
        userId:
          type: string
          description: Kaydedilen Kullanıcının ID Numarası
          example: 8e94a551-5b86-40ba-ae55-b019dee5cc25
        username:
          type: string
          description: Kaydedilen Kullanıcı İsmi
          example: name@domain.com
        firstName:
          type: string
          description: Kaydedilen Kullanıcının İlk Adı
          example: John
        midName:
          type: string
          description: Kaydedilen Kullanıcının Göbek Adı
          example: Bob
        lastName:
          type: string
          description: Kaydedilen Kullanıcının Soy Adı
          example: Doe
        locale:
          type: string
          description: Kaydedilen Kullanıcının Yerel Ayarı
          example: tr_TR
        timezone:
          type: string
          description: Kaydedilen Kullanıcının Zaman Dilimi Id'si
          example: Europe/Istanbul
        roles:
          uniqueItems: true
          type: array
          description: Kaydedilen Kullanıcının Rolleri
          example: API_USER
          items:
            type: string
            description: '{msg:swagger.schema.auth.register-response.roles}'
            example: API_USER
            enum:
              - GUEST
              - API_USER
              - STANDARD_USER
              - POWER_USER
              - EXTENDED_USER
              - ADMIN
        status:
          type: string
          description: Kaydedilen Kullanıcının Durumu
          example: INACTIVE
          enum:
            - INACTIVE
            - ACTIVE
            - EXPIRED
            - BLOCKED
            - DELETED
        account:
          $ref: '#/components/schemas/Account'
    StandardErrorResponse:
      required:
        - error
        - message
        - path
        - status
        - timestamp
      type: object
      properties:
        timestamp:
          type: string
          description: Hata Zaman Damgası
          format: date-time
        status:
          type: integer
          description: Hata Durum Kodu
          format: int32
        error:
          type: string
          description: Hata Adı
          example: Error Name
        message:
          type: string
          description: Hata Açıklaması
          example: Error Message
        path:
          type: string
          description: Hata Veren Endpoint URI
          example: /endpoint/uri/here
    Account:
      type: object
      properties:
        id:
          type: string
          format: uuid
        userId:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - INDIVIDUAL
            - ORGANIZATION
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        mobilePhoneNumber:
          type: string
        location:
          type: string
        company:
          type: string
        industry:
          type: string
        profilePictureUrl:
          type: string
        subscriptionPlan:
          type: string
          enum:
            - NONE
            - TRIAL
            - BASIC_MONTHLY
            - BASIC_YEARLY
            - PREMIUM_MONTHLY
            - PREMIUM_YEARLY
            - CUSTOM
        emailVerified:
          type: boolean
        mobilePhoneNumberVerified:
          type: boolean

````