> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# تحديث المفتاح

> يحدّث خصائص مفتاح API.



## OpenAPI

````yaml /ar/_specs/cloud-openapi.json patch /v1/organizations/{organizationId}/keys/{keyId}
openapi: 3.0.1
info:
  contact:
    email: support@clickhouse.com
    name: ClickHouse Support
    url: >-
      https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-299828
  title: OpenAPI spec for ClickHouse Cloud
  version: '1.0'
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: User management
  - name: Billing
  - name: Service
  - name: Backup
  - name: OpenAPI
  - name: Prometheus
  - name: ClickPipes
paths:
  /v1/organizations/{organizationId}/keys/{keyId}:
    patch:
      tags:
        - OpenAPI
      summary: تحديث المفتاح
      description: يحدّث خصائص مفتاح API.
      parameters:
        - description: معرّف المؤسسة المالكة للمفتاح.
          in: path
          name: organizationId
          required: true
          schema:
            format: uuid
            type: string
        - description: معرّف المفتاح المطلوب تحديثه.
          in: path
          name: keyId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyPatchRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    description: معرّف فريد يُخصَّص لكل طلب. UUIDv4
                    format: uuid
                    type: string
                  result:
                    $ref: '#/components/schemas/ApiKey'
                  status:
                    description: رمز حالة HTTP.
                    example: 200
                    type: number
                type: object
          description: استجابة ناجحة
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: وصف تفصيلي للخطأ.
                    type: string
                  status:
                    description: رمز حالة HTTP.
                    example: 400
                    type: number
                type: object
          description: >-
            يتعذر على الخادم معالجة الطلب أو يرفض معالجته بسبب أمر يُعدّ خطأ من
            جهة العميل.
components:
  schemas:
    ApiKeyPatchRequest:
      properties:
        expireAt:
          description: >-
            الطابع الزمني لانتهاء صلاحية المفتاح. إذا كانت القيمة `null` أو كانت
            فارغة، فلن تنتهي صلاحية المفتاح مطلقًا. ISO-8601.
          format: date-time
          nullable: true
          type: string
        ipAccessList:
          description: >-
            قائمة عناوين IP المسموح لها بالوصول إلى واجهة برمجة التطبيقات
            باستخدام هذا المفتاح
          items:
            $ref: '#/components/schemas/IpAccessListEntry'
          type: array
        name:
          description: اسم المفتاح
          type: string
        roles:
          description: قائمة الأدوار المعيّنة للمفتاح. تحتوي على عنصر واحد على الأقل.
          items:
            enum:
              - admin
              - developer
              - query_endpoints
            type: string
          type: array
        state:
          description: 'حالة المفتاح: ''enabled''، ''disabled''.'
          enum:
            - enabled
            - disabled
          type: string
    ApiKey:
      properties:
        createdAt:
          description: الطابع الزمني لإنشاء المفتاح. ISO-8601.
          format: date-time
          type: string
        expireAt:
          description: >-
            الطابع الزمني لانتهاء صلاحية المفتاح. إذا لم يكن موجودًا، أو كانت
            قيمته `null`، أو كان فارغًا، فلن تنتهي صلاحية المفتاح أبدًا.
            ISO-8601.
          format: date-time
          nullable: true
          type: string
        id:
          description: المعرّف الفريد لمفتاح API.
          format: uuid
          type: string
        ipAccessList:
          description: >-
            قائمة بعناوين IP المسموح لها بالوصول إلى واجهة API باستخدام هذا
            المفتاح
          items:
            $ref: '#/components/schemas/IpAccessListEntry'
          type: array
        keySuffix:
          description: آخر 4 أحرف من المفتاح.
          type: string
        name:
          description: اسم المفتاح
          type: string
        roles:
          description: قائمة الأدوار المعيّنة للمفتاح. تحتوي على عنصر واحد على الأقل.
          items:
            enum:
              - admin
              - developer
              - query_endpoints
            type: string
          type: array
        state:
          description: 'حالة المفتاح: ''enabled''، ''disabled''.'
          enum:
            - enabled
            - disabled
          type: string
        usedAt:
          description: >-
            الطابع الزمني لآخر مرة استُخدم فيها المفتاح. إذا لم يكن موجودًا،
            فهذا يعني أن المفتاح لم يُستخدم مطلقًا. ISO-8601.
          format: date-time
          type: string
    IpAccessListEntry:
      properties:
        description:
          description: وصف اختياري لعنوان IPv4 أو IPv4 CIDR المسموح بالوصول منه
          type: string
        source:
          description: IP أو CIDR
          type: string
  securitySchemes:
    basicAuth:
      description: >-
        استخدم معرّف المفتاح والسرّ الخاص به اللذين تم الحصول عليهما من
        ClickHouse Cloud console:
        https://clickhouse.com/docs/cloud/manage/openapi
      scheme: basic
      type: http

````