Get Started with the Capella Operational Management API
- Capella Operational
- how-to
To get started with the Couchbase Capella Operational Management API, you must create an API key. An API key authenticates and authorizes you to access the Management API.
This page is for Capella operational. For Capella AI Services, see Get Started with Capella AI Services APIs. For Capella Analytics, see Get Started with the Capella Analytics Management API.
This page describes how to create and manage API keys for the Management API only.
To create an initial bootstrap API key to access the Management API, you must use the Capella UI. Once you have created an initial bootstrap API key, you can use the Management API itself to create further API keys.
Understand Management API Keys
Each API key for the Management API has the following characteristics:
-
API keys are associated with Couchbase Capella roles and permissions.
-
Every API key has an expiration date.
-
Every API key is associated with an allowed IP address list.
Organization Roles and Project Access
Each API key is associated with 1 or more organization roles, which determine the privileges that the API key has within the organization. For more information about organization roles, see Organization Roles.
Each API key may have access to 1 or more projects, depending on the organization role. For each project, each API key is associated with 1 or more project roles, which determine the privileges that the API key has within each project. For more information about project roles, see Project Roles.
You can create an API key at the organization or a project level:
-
When you create an API key at the organization level, you may specify the organization roles for the API key, which projects the API key is associated with, and the project roles for the API key within each project.
-
When you create an API key at the project level, the API key has the
Organization Memberrole for the organization containing the project, and has access to the project where you created it. You may specify project roles for the API key within that project.
An API key must have the appropriate Capella roles to access an endpoint. The Management API reference guide lists the roles that are needed for each endpoint.
Expiration
By default, each API key expires 180 days after creation. You can specify a different expiration, or specify that the API key does not expire. For security, create new API keys regularly and let old API keys expire after transitioning to the new keys.
IP Access
By default, when you first create an API key, you can use that API key to access the Management API from any IP address. For security, each API key should only be able to access the Management API from specific IP addresses.
For each API key, you can grant access from:
-
Individual IP addresses in IPv4 format.
-
Blocks of IP addresses in IPv4 format using CIDR notation.
Display Management API Keys
You can display Management API keys within an organization or within a project. By default, there are no API keys for the Management API.
-
Organization Level
-
Project Level
To display Management API keys within an organization:
-
In the Capella UI, click your initials.
-
Click Organizations.
-
Select the organization you want to create API keys for.
-
Go to .
To display Management API keys within a project:
-
In your organization, go to Projects.
-
Select the project you want to create API keys for.
-
Go to .
Generate Management API Keys
You can generate Management API keys within an organization or within a project.
-
Organization Level
-
Project Level
To generate a Management API key at the organization level:
-
Display the list of Management API keys within the organization.
-
Click Generate Key.
-
In the Key Name field, enter a name for the API key.
-
(Optional) In the Description field, enter a description of the API key.
-
In Organization Roles, select 1 or more organization roles for the API key.
-
If the API key has the
Organization Memberrole, configure the projects that the API key can access:-
Click Configure Project Access.
-
Enable the projects you want the API key to access, or click Select all.
-
For each project which the API key can access, select 1 or more project roles for the API key.
-
Click Save.
-
-
In Key Expiration, accept the default expiration, change the expiration, or specify that the key should not expire.
-
In Allowed IP Addresses, click Added Allowed IP Address to specify IP access for the API key.
-
Select 1 of the following options:
-
To allow a specific IP address or block, in the Add IP / CIDR Block field, enter the IP address or CIDR notation.
-
To add your current IP address block, click Add Current IP Address.
-
-
Click Add.
-
When you’re ready, click Generate Key.
The Capella UI shows the new API key ID and the new API key token. The API key token is hidden to prevent others reading it.
You must copy or download the API key token now. When you leave this page, you will not be able to copy or download the API key token again. -
To download the API key token, click Download Key. The key is saved by your browser in a file called
<name>-api-key-token.txt, where<name>is the name of the API key. -
To copy either the API key ID or the API key token to the clipboard, click the copy icon () next to the field.
To generate a Management API key at the project level:
-
Display the list of Management API keys within the project.
-
Click Generate Key.
-
In the Key Name field, enter a name for the API key.
-
(Optional) In the Description field, enter a description of the API key.
-
In Roles, select 1 or more project roles for the API key.
-
In the Key Expiration, accept the default expiration, change the expiration, or specify that the key should not expire.
-
In Allowed IP Addresses, click Added Allowed IP Address to specify IP access for the API key.
-
Select 1 of the following options:
-
To allow a specific IP address or block, in the Add IP / CIDR Block field, enter the IP address or CIDR notation.
-
To add your current IP address, click Add Current IP Address.
-
-
Click Add.
-
When you’re ready, click Generate Key.
The Capella UI shows the new API key ID and the new API key token. The API key token is hidden to prevent others reading it.
You must copy or download the API key token now. After leaving this page, you cannot copy or download the API key token. -
To download the API key token, click Download Key. The key is saved by your browser in a file called
<name>-api-key-token.txt, where<name>is the name of the API key. -
To copy either the API key ID or the API key token to the clipboard, click the copy icon () next to the field.
View Management API Keys
To view details of a Management API key:
-
Display the list of Management API keys within an organization or within a project.
-
Click the name of the API key.
The details of the API key are displayed: the name, description, organization roles, expiration, allowed IP addresses, and project access.
Delete Management API Keys
To delete a Management API key:
-
Display the list of Management API keys within an organization or within a project.
-
Next to the API key you want to delete, click the trash can icon ().
-
In the confirmation dialogue, confirm that you want to delete the API key.
-
Click Delete.
Next Steps
-
To make an API call, see Make an API Call with the Capella Operational Management API.
-
For a full reference guide, see Capella Operational Management API Reference.
-
For an error reference, see Capella Operational Management API Errors.