Programmatic Access to Atlas¶
To grant programmatic access to an organization or project using only the API, you can create an API key. API keys:
- Have two parts: a Public Key and a Private Key. These serve the same function as a username and Personal API Key when making API requests to Atlas.
- Cannot be used to log into Atlas through the user interface.
- Must be granted roles as you would Users to make sure the API Keys can call API endpoints without errors.
- Can belong to one organization, but may be granted access to any number of projects in that organization.
Manage Programmatic Access to an Organization¶
To perform any of the following actions, you must have the
Organization Owner
role.
Create an API Key in an Organization¶
Navigate to the Access Manager page for your organization.¶
- If it is not already displayed, select your desired organization from the Organizations menu in the navigation bar.
- Click Access Manager in the sidebar, or click Access Manager in the navigation bar, then click your organization.
Click Create API Key.¶
Enter the API Key Information.¶
- Enter a Description.
- In the Organization Permissions menu, select the new role or roles for the API key.
Click Next.¶
Copy and save the Public Key.¶
The public key acts as the username when making API requests.
Copy and save the Private Key.¶
The private key acts as the password when making API requests.
The Private Key is only shown once: on this page. Click the Copy button to add the Private Key to the clipboard. Save and secure both the Public and Private Keys.
Add an API Access List Entry.¶
- Click Add Access list Entry.
Enter an IP address from which you want Atlas to accept API requests for this API Key.
You can also click Use Current IP Address if the host you are using to access Atlas also will make API requests using this API Key.
- Click Save.
Click Done.¶
View the Details of an API Key in an Organization¶
Navigate to the Access Manager page for your organization.¶
- If it is not already displayed, select your desired organization from the Organizations menu in the navigation bar.
- Click Access Manager in the sidebar, or click Access Manager in the navigation bar, then click your organization.
Click the API Keys tab.¶
View the Access List.¶
- Click to the right of the API Key.
- Click View Details.
The <Public Key> API Key Details modal displays:
- The obfuscated Private Key
- The date the Key was last used
- The date the Key was created
- The IP addresses from which the Key can access the API
- The projects to which the Key has been granted access
Change an API Key in an Organization¶
You can change the roles, description, or access list of an API Key in an Organization.
Navigate to the Access Manager page for your organization.¶
- If it is not already displayed, select your desired organization from the Organizations menu in the navigation bar.
- Click Access Manager in the sidebar, or click Access Manager in the navigation bar, then click your organization.
Click the API Keys tab.¶
From the ellipsis menu to the right of the API Key you want to change, click Edit.¶
Edit the API Key Information.¶
On the Add API Key page:
- Modify the Description.
- In the Organization Permissions menu, select the new role or roles for the API key.
Click Next.¶
Edit the API Access List.¶
To add an IP address or CIDR block from which you want Atlas to accept API requests for this API Key, click Add Access list Entry and type an IP address.
You can also click Use Current IP Address if the host you are using to access Atlas also will make API requests using this API Key.
- To remove an IP address from the access list, click to the right of the IP address.
- Click Save.
Click Done.¶
Delete an API Key from an Organization¶
Navigate to the Access Manager page for your organization.¶
- If it is not already displayed, select your desired organization from the Organizations menu in the navigation bar.
- Click Access Manager in the sidebar, or click Access Manager in the navigation bar, then click your organization.
Click the API Keys tab.¶
Click to the right of the API Key that you want to delete.¶
Click Delete to confirm that you want to delete this API Key or Cancel to leave the key in the Organization.¶
Removing an API Key from an Organization also removes that key from any projects to which the key was granted access.
Manage Programmatic Access to a Project¶
To perform any of the following actions, you must have the
Project Owner
role.
Create an API Key for a Project¶
Navigate to the Access Manager page for your project.¶
- If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
- Select your desired project from the list of projects in the Projects page.
- Click the vertical ellipsis () next to your project name in the upper left corner and select Project Settings.
- Click Access Manager in the navigation bar, then click your project.
Click Create API Key.¶
Enter the API Key Information.¶
On the Create API Key page:
- Enter a Description.
- In the Project Permissions menu, select the new role or roles for the API key.
Click Next.¶
Copy and save the Public Key.¶
The public key acts as the username when making API requests.
Copy and save the Private Key.¶
The private key acts as the password when making API requests.
The Private Key is only shown once: on this page. Click the Copy button to add the Private Key to the clipboard. Save and secure both the Public and Private Keys.
Add an API Access List Entry.¶
- Click Add Access List Entry.
Enter an IP address from which you want Atlas to accept API requests for this API Key.
You can also click Use Current IP Address if the host you are using to access Atlas will also make API requests using this API Key.
- Click Save.
Click Done.¶
View the Details of an API Key in a Project¶
Navigate to the Access Manager page for your project.¶
- If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
- Select your desired project from the list of projects in the Projects page.
- Click the vertical ellipsis () next to your project name in the upper left corner and select Project Settings.
- Click Access Manager in the navigation bar, then click your project.
Click the API Keys tab.¶
View the Access List.¶
- Click to the right of the API Key.
- Click View Details.
The <Public Key> API Key Details modal displays the following information:
- The obfuscated Private Key
- The date the key was last used
- The date the key was created
- The IP address or addresses from which the API key can access the API
Change an API Key's Roles in a Project¶
Navigate to the Access Manager page for your project.¶
- If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
- Select your desired project from the list of projects in the Projects page.
- Click the vertical ellipsis () next to your project name in the upper left corner and select Project Settings.
- Click Access Manager in the navigation bar, then click your project.
Click the API Keys tab.¶
Edit the Access List.¶
- Click to the right of the API Key.
- Click Edit Permissions.
Select the new role or roles for the API Key from the Project Permissions menu.¶
Click the to save.¶
Edit an API Key's Access List¶
Navigate to the Access Manager page for your project.¶
- If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
- Select your desired project from the list of projects in the Projects page.
- Click the vertical ellipsis () next to your project name in the upper left corner and select Project Settings.
- Click Access Manager in the navigation bar, then click your project.
Click the API Keys tab.¶
Edit the Access List.¶
- Click to the right of the API Key.
- Click Edit Permissions.
Selecting Edit Permissions takes you to the organization level of the Atlas console.
Edit the API Access List.¶
You cannot modify an existing API Key access list entry. You must delete and re-create it.
- Click to the right of the IP address to remove it.
Add the new IP address from which you want Atlas to accept API requests for this API Key. Use one of the two options:
- Click Add access list Entry and type an IP address, or
- Click Use Current IP Address if the host you are using to access Atlas will also make API requests using this API Key.
- Click Save.