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

# キーを更新

> API keyのプロパティを更新します。



## OpenAPI

````yaml /ja/products/cloud/api-reference/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 keyのプロパティを更新します。
      parameters:
        - description: keyを所有する組織のID。
          in: path
          name: organizationId
          required: true
          schema:
            format: uuid
            type: string
        - description: 更新するkeyの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: 各リクエストに割り当てられる一意のID。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: このキーを使用した API へのアクセスを許可する IP アドレスの一覧
          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: 一意の API key ID。
          format: uuid
          type: string
        ipAccessList:
          description: このキーを使用してAPIへのアクセスが許可されているIPアドレスの一覧
          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 コンソールで取得した key ID と key secret を使用してください:
        https://clickhouse.com/docs/cloud/manage/openapi
      scheme: basic
      type: http

````