Manage Programmatic Access to a Project
On this page
- OAuth 2.0 authentication for programmatic access to Atlas is available as a Preview feature.
- The feature and the corresponding documentation might change at any time during the Preview period. To use OAuth 2.0 authentication, create a service account to use in your requests to the Atlas Administration API.
Use the following procedures to manage programmatic access to a project. To learn more, see Grant Programmatic Access to a Project.
Required Access
To perform any of the following actions, you must have
Project Owner
access to the project.
View the API Keys in a Project
To list all API keys for your project using the Atlas CLI, run the following command:
atlas projects apiKeys list [options]
To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas projects apiKeys list.
You can view the API access list entries for a project
API key using an atlas organizations
command.
To list IP access list entries for your API key using the Atlas CLI, run the following command:
atlas organizations apiKeys accessLists list <apiKeyID> [options]
To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas organizations apiKeys accessLists list.
To view the details of an API key in a project using the Atlas UI:
In Atlas, go to the Project Access Manager page.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
If it's not already displayed, select your desired project from the Projects menu in the navigation bar.
Do one of the following steps:
Select Project Access from the Access Manager menu in the navigation bar.
Next to the Projects menu, expand the Options menu, click Project Settings, and click Access Manager in the sidebar.
The Project Access Manager page displays.
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
In Atlas, go to the Project Access Manager page.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
If it's not already displayed, select your desired project from the Projects menu in the navigation bar.
Do one of the following steps:
Select Project Access from the Access Manager menu in the navigation bar.
Next to the Projects menu, expand the Options menu, click Project Settings, and click Access Manager in the sidebar.
The Project Access Manager page displays.
Select the new role or roles for the API Key from the Project Permissions menu.
Edit an API Key's Access List
You can edit the API access list entries for a project API
key using atlas organizations
commands.
Add an API Access List Entry for the API Key
To create an IP access list entry for your API key using the Atlas CLI, run the following command:
atlas organizations apiKeys accessLists create [options]
To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas organizations apiKeys accessLists create.
Delete an API Access List Entry for the API Key
To delete an IP access list entry for your API key using the Atlas CLI, run the following command:
atlas organizations apiKeys accessLists delete <entry> [options]
To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas organizations apiKeys accessLists delete.
In Atlas, go to the Project Access Manager page.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
If it's not already displayed, select your desired project from the Projects menu in the navigation bar.
Do one of the following steps:
Select Project Access from the Access Manager menu in the navigation bar.
Next to the Projects menu, expand the Options menu, click Project Settings, and click Access Manager in the sidebar.
The Project Access Manager page displays.
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 or CIDR block 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.
Delete an API Key from a Project
To delete an API key for your project using the Atlas CLI, run the following command:
atlas projects apiKeys delete <ID> [options]
To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas projects apiKeys delete.
To delete an API key from a project using the Atlas UI:
In Atlas, go to the Project Access Manager page.
If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.
If it's not already displayed, select your desired project from the Projects menu in the navigation bar.
Do one of the following steps:
Select Project Access from the Access Manager menu in the navigation bar.
Next to the Projects menu, expand the Options menu, click Project Settings, and click Access Manager in the sidebar.
The Project Access Manager page displays.