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

# Обновить ключ

> Обновляет свойства API-ключа.



## OpenAPI

````yaml /ru/_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: ID организации, которой принадлежит ключ.
          in: path
          name: organizationId
          required: true
          schema:
            format: uuid
            type: string
        - description: ID ключа, который нужно обновить.
          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-адресов, которым разрешен доступ к API с использованием
            этого ключа
          items:
            $ref: '#/components/schemas/IpAccessListEntry'
          type: array
        name:
          description: Имя ключа
          type: string
        roles:
          description: Список ролей, назначенных ключу. Содержит как минимум 1 элемент.
          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: Уникальный ID 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: Список ролей, назначенных ключу. Содержит как минимум 1 элемент.
          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: https://clickhouse.com/docs/cloud/manage/openapi
      scheme: basic
      type: http

````