Read one level up: https://skills.qdrant.tech/md/documentation/cloud

> Explore Qdrant's agent skills catalog at https://skills.qdrant.tech/
> Search the documentation at https://skills.qdrant.tech/md/documentation?q=your+query+here
> Use this file for an index of the main pages: https://qdrant.tech/llms.txt
> Content inside `<only-applies-to>` tags applies only to the named products, or only as of the named version, and never to products it says it does not apply to. All other content applies to every Qdrant product. If you know which product the user is on, ignore tagged content for other products.


# Database Authentication in Qdrant Managed Cloud

Qdrant Cloud uses three kinds of credentials. Each one protects a different surface:

| Credential | Protects | Created in | Sent as |
|---|---|---|---|
| Database API key | A cluster's REST and gRPC APIs, plus its `/metrics` and `/sys_metrics` endpoints | **API Keys** on the Cluster Detail page | The `api-key` header, or `Authorization: Bearer <key>` |
| Cloud Management Key | The [Cloud API](https://skills.qdrant.tech/md/documentation/cloud-automation/cloud-api), the [`qcloud` CLI](https://skills.qdrant.tech/md/documentation/cloud-automation/cloud-cli), and [Terraform](https://skills.qdrant.tech/md/documentation/cloud-automation/terraform) | **Access Management** > **Cloud Management Keys** | `Authorization: apikey <key>` |
| Console sign-in | The Cloud Console | Email, Google, GitHub, or [SSO](https://skills.qdrant.tech/md/documentation/cloud-account-setup?s=enterprise-single-sign-on-sso) | A session. What a user can do is set by [Cloud RBAC](https://skills.qdrant.tech/md/documentation/cloud-account-setup/rbac) |

These credentials are independent: a key from one does not grant access to the others. SSO covers Console sign-in only.

This page covers Database API keys. Creating one needs the `write:api_keys` permission, and revoking one needs `delete:api_keys`. See the [permission reference](https://skills.qdrant.tech/md/documentation/cloud-account-setup/permission-reference?s=api-keys).

## Create Database API Keys

<aside role="alert">
    The API key is only shown once after creation. If you lose it, you will need to create a new one. 
</aside>

**Cloud Console:**

![API Key](https://qdrant.tech/documentation/cloud/create-api-key.png)

1. Go to the [Cloud Dashboard](https://qdrant.to/cloud).
2. Go to the **API Keys** section of the **Cluster Detail Page**.
3. Click **Create**.
4. Choose a name and an optional expiration (in days, the default is 90 days) for your API key. An empty expiration will result in no expiration.
5. By default, tokens are given cluster-wide permissions, with a choice between manage/write permissions (default) or read-only.<br/><br/>To restrict a token to a subset of collections, you can select the Collections tab and choose from the collections available in your cluster.
6. Click **Create** and retrieve your API key.

![API Key](https://qdrant.tech/documentation/cloud/api-key.png)

**qcloud CLI:**

1. Find the ID of the cluster.

   ```sh
   qcloud cluster list
   ```

1. Create a key with manage access. Without `--access-type`, the key gets manage access.

   ```sh
   qcloud cluster key create <CLUSTER_ID> --name my-key --expires 2027-06-30 --wait
   ```

1. Create a read-only key.

   ```sh
   qcloud cluster key create <CLUSTER_ID> --name read-key --access-type read-only --expires 2027-06-30 --wait
   ```

The `--expires` flag takes a date in `YYYY-MM-DD` format, and the key is valid until the end of that day (UTC). The `--wait` flag returns when the key is active on the cluster.

List the keys of a cluster with `qcloud cluster key list <CLUSTER_ID>`. The CLI creates keys with cluster-wide permissions. It does not create keys that are restricted to a subset of collections.


Database API keys with granular access control start with `eyJhb` and require cluster version **v1.11.0** or later. See the [Table of Access](https://skills.qdrant.tech/md/documentation/security?s=table-of-access) for the actions each permission level allows.

A new key can take a few seconds to become active. If the first request returns `403`, retry. Once a key passes its expiration, requests with it also return `403`.

<iframe width="560" height="315" src="https://www.youtube.com/embed/3c-8tcBIVdQ?si=OoyobgPTU-DHIhee" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## Authenticate With a Key

Include the key in every request, over REST or gRPC. Use the `api-key` header or the client's API key parameter:

```bash
curl -X GET https://xyz-example.eu-central.aws.cloud.qdrant.io:6333 \
  --header 'api-key: your_api_key_here'
```

> This snippet is also available in Python, Typescript, Rust, Java, Csharp, and Go. See the [full snippet](https://skills.qdrant.tech/md/documentation/snippets/authentication/api-key).


Alternatively, send the key as a Bearer token in the `Authorization` header:

```bash
curl -X GET https://xyz-example.eu-central.aws.cloud.qdrant.io:6333 \
  --header 'Authorization: Bearer your_token_here'
```

> This snippet is also available in Python, Typescript, Rust, Java, Csharp, and Go. See the [full snippet](https://skills.qdrant.tech/md/documentation/snippets/authentication/bearer).


A successful request to the cluster root returns the server title, version, and commit:

```json
{"title":"qdrant - vector search engine","version":"<version>","commit":"<commit-hash>"}
```

For the endpoint format, ports, and node-specific endpoints, see [Connect to a Cluster](https://skills.qdrant.tech/md/documentation/cloud/cluster-access). If a request fails with `401` or `403`, see [Troubleshooting](https://skills.qdrant.tech/md/documentation/common-errors?s=unauthorized-and-forbidden-http-401-and-403).

## Rotate and Revoke Keys

Set an expiration on every key, and replace keys before they expire:

1. Create a new key with the same permissions.
2. Deploy the new key to your application.
3. Revoke the old key.

Use one key per application or environment, so that revoking one key interrupts only the application that uses it. Give each key the narrowest permission it needs: read-only for query-only services, and collection-restricted keys for tenants or teams.

To find and revoke a key:

**Cloud Console:**

Revoke the key in the **API Keys** section of the Cluster Detail Page.

**qcloud CLI:**

1. Find the ID of the cluster.

   ```sh
   qcloud cluster list
   ```

1. List the keys of the cluster to find the ID of the key.

   ```sh
   qcloud cluster key list <CLUSTER_ID>
   ```

1. Delete the key. The command asks for confirmation. Use the `--force` flag to skip it.

   ```sh
   qcloud cluster key delete <CLUSTER_ID> <KEY_ID>
   ```


### When a User Leaves

<aside role="alert">
    A Database API key or Cloud Management Key is <strong>not</strong> deleted or revoked when the user who created it is removed or deleted from the account. The key keeps working with whatever permissions it was granted.
</aside>

Before or when you [remove a user from an account](https://skills.qdrant.tech/md/documentation/cloud-account-setup/user-management?s=removing-a-user-from-an-account):

**Cloud Console:**

1. Revoke every Database API key that the user created, in the **API Keys** section of each cluster.
2. Revoke every Cloud Management Key that the user created, in **Access Management** > **Cloud Management Keys**.
3. Replace the revoked keys in the applications that used them.

**qcloud CLI:**

The tables that `qcloud` prints do not show who created a key. The JSON output includes the creator's email address as `createdByEmail`, so filter on it (needs `jq`).

1. List your clusters, to get their IDs.

   ```sh
   qcloud cluster list
   ```

1. Revoke every Database API key that the user created. For each cluster, find the keys that the user created.

   ```sh
   qcloud cluster key list <CLUSTER_ID> --json \
     | jq -r '.items[]? | select(.createdByEmail == "<USER_EMAIL>") | .id'
   ```

1. Delete each of those keys.

   ```sh
   qcloud cluster key delete <CLUSTER_ID> <KEY_ID>
   ```

1. Find the Cloud Management Keys that the user created.

   ```sh
   qcloud iam key list --json \
     | jq -r '.items[]? | select(.createdByEmail == "<USER_EMAIL>") | .id'
   ```

1. Delete each of those keys.

   ```sh
   qcloud iam key delete <KEY_ID>
   ```

1. Replace the revoked keys in the applications that used them.


## Admin Database API Keys

The previous iteration of Database API keys, called Admin Database API keys, do not have granular access control. Clusters created before January 27, 2025 will still see the option to create Admin Database API keys. Older Admin Database API keys will continue to work, but we do recommend switching to Database API keys with granular access control to take advantage of better security controls.

<aside role="alert">
    Enabling Database API keys with granular access control will trigger a restart of your cluster.
</aside>

To enable Database API keys with granular access control, click **Enable** on the **API Keys** section of the Cluster detail page.

After enabling Database API keys with granular access control for a cluster, existing Admin Database API keys will continue to work, but you will not be able to create new Admin Database API Keys.