---
title: "Get list of keys"
method: GET
path: "/v1/organizations/{organizationId}/keys"
tags: ["API keys"]
---

# Get list of keys

`GET /v1/organizations/{organizationId}/keys`

## Request

- Base URL: `https://api.clickhouse.cloud`
- URL: `https://api.clickhouse.cloud/v1/organizations/{organizationId}/keys`
- Auth: HTTP basic

Returns a list of keys in the organization, ordered by creation date, oldest first. Results are capped at `limit` (default 250) per page; the server may return fewer and caps the value at its own maximum. Every response carries `limit`, `totalCount` and `nextCursor`; pass `nextCursor` as the `cursor` query parameter to fetch the next page, repeating until it is null.

## Path parameters

- `organizationId` string, uuid, required

## Query parameters

- `limit` integer
- `cursor` string

## Response `200`

Successful response

- object
  - `status` number: HTTP status code.
  - `requestId` string, uuid: Unique id assigned to every request. UUIDv4
  - `result` ApiKey[]: List of results.
    - `id` string, uuid: Unique API key ID.
    - `name` string: Name of the key
    - `state` 'enabled' | 'disabled': State of the key: 'enabled', 'disabled'.
    - `roles` string[]: DEPRECATED. Use `assignedRoles` instead. List of roles assigned to the key. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect current role assignments.
    - `assignedRoles` AssignedRole[]: Custom roles and System roles assigned to this API key
      - `roleId` string, uuid: Unique identifier of the role
      - `roleName` string: Human-readable name of the role
      - `roleType` 'system' | 'custom': Type of role: system (predefined) or custom (organization-defined)
    - `keySuffix` string: Last 4 letters of the key.
    - `createdAt` string, date-time: Timestamp the key was created. ISO-8601.
    - `expireAt` string, date-time, nullable: Timestamp the key expires. If not present, `null` or is empty the key never expires. ISO-8601.
    - `usedAt` string, date-time: Timestamp the key was used last time, with one-minute precision. If not present the key was never used. ISO-8601.
    - `ipAccessList` IpAccessListEntry[]: List of IP addresses allowed to access the API using this key
      - `source` string: IP or CIDR
      - `description` string: Optional description of IPv4 address or IPv4 CIDR to allow access from
  - `limit` integer: Maximum number of results returned in this page.
  - `totalCount` integer, nullable: Total number of results across all pages. It has only informative value, thus is not guaranteed and it is provided on a best-effort basis. Null if the total count is unknown.
  - `nextCursor` string, nullable: Cursor for the next page, to be sent as the `cursor` query parameter. Null on the last page.

## Other responses

- `400`: The request cannot be processed due to a client error. Please verify your request parameters and try again.
- `500`: An internal server error has occurred. If this issue persists, please contact ClickHouse Cloud support for assistance.

---

[API](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud.md) - [All operations](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/revisions/eac345053548?raw)
