Skip to main content

Managing API Keys

ClickHouse Cloud provides an API utilizing OpenAPI that allows you to programmatically manage your account and aspects of your services.

Managing API Keys

Note

This document covers the ClickHouse Cloud API. For database API endpoints, please see Cloud Endpoints API

  1. You can use the API Keys tab on the left menu to create and manage your API keys.

    ClickHouse Cloud API Keys Tab

  2. The API Keys page will initially display a prompt to create your first API key as shown below. After your first key is created, you can create new keys using the New API Key button that appears in the top right corner.

    Initial API Screen

  3. To create an API key, specify the key name, permissions for the key, and expiration time, then click Generate API Key.

    Create API Key

  4. The next screen will display your Key ID and Key secret. Copy these values and put them somewhere safe, such as a vault. The values will not be displayed after you leave this screen.

    API Key ID and Key Secret

  5. The ClickHouse Cloud API uses HTTP Basic Authentication to verify the validity of your API keys. Here is an example of how to use your API keys to send requests to the ClickHouse Cloud API using curl:

$ KEY_ID=mykeyid
$ KEY_SECRET=mykeysecret

$ curl --user $KEY_ID:$KEY_SECRET https://api.clickhouse.cloud/v1/organizations
  1. Returning to the API Keys page, you will see the key name, last four characters of the Key ID, permissions, status, expiration date, and creator. You are able to edit the key name, permissions, and expiration from this screen. Keys may also be disabled or deleted form this screen.
Note

Deleting an API key is a permanent action. Any services using the key will immediately lose access to ClickHouse Cloud.

API Key Management

Endpoints

The endpoint docs are here. Use your API Key and API Secret with the base URL https://api.clickhouse.cloud/v1.