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

# 获取所有密钥列表

> 返回该 organization 中所有密钥的列表。



## OpenAPI

````yaml /zh/_specs/cloud-openapi.json get /v1/organizations/{organizationId}/keys
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:
    get:
      tags:
        - OpenAPI
      summary: 获取所有密钥列表
      description: 返回该 organization 中所有密钥的列表。
      parameters:
        - description: 请求的 organization 的 ID。
          in: path
          name: organizationId
          required: true
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    description: 分配给每个请求的唯一 ID。UUIDv4
                    format: uuid
                    type: string
                  result:
                    items:
                      $ref: '#/components/schemas/ApiKey'
                    type: array
                  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: 由于请求存在被视为客户端错误的问题，server 无法或不会处理该请求。
components:
  schemas:
    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

````