Docs Menu
Docs Home
/
MongoDB Atlas
/ / /

Manage Programmatic Access to an Organization

On this page

  • Required Access
  • View API Keys in an Organization
  • Change an API Key in an Organization
  • Delete an API Key from an Organization

Use the following procedures to manage programmatic access to an organization. To learn more, see Grant Programmatic Access to an Organization.

To perform any of the following actions, you must have Organization Owner access to Atlas.

You can view a list of API keys, the details of an API key, or the access list for an API key in an organization using the Atlas CLI.

To list all API keys in an organization using the Atlas CLI, run the following command:

atlas organizations apiKeys list [options]

To return the details for an API key in an organization using the Atlas CLI, run the following command:

atlas organizations apiKeys describe <ID> [options]

To learn more about the syntax and parameters for the previous commands, see the Atlas CLI documentation for atlas organizations apiKeys list and atlas organizations apiKeys describe.

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 an organization using the Atlas UI:

1
  1. If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.

  2. Do one of the following steps:

    • Select Organization Access from the Access Manager menu in the navigation bar.

    • Click Access Manager in the sidebar.

    The Organization Access Manager page displays.

2
3
  1. Click to the right of the API Key.

  2. 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

You can change the roles or access list for an API key in an organization using the Atlas CLI.

To update an API key in an organization using the Atlas CLI, run the following command:

atlas organizations apiKeys assign <apiKeyId> [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas organizations apiKeys assign.

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.

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.

You can change the roles, description, or access list for an API Key in an organization using the Atlas UI.

1
  1. If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.

  2. Do one of the following steps:

    • Select Organization Access from the Access Manager menu in the navigation bar.

    • Click Access Manager in the sidebar.

    The Organization Access Manager page displays.

2
3
4

On the Add API Key page:

  1. Modify the Description.

  2. In the Organization Permissions menu, select the new role or roles for the API key.

5
6
  1. 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.

  2. To remove an IP address from the access list, click to the right of the IP address.

  3. Click Save.

7

To delete an API key from an organization using the Atlas CLI, run the following command:

atlas organizations apiKeys delete <ID> [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas organizations apiKeys delete.

To delete an access list entry for an API key in an organization, see Change an API Key in an Organization.

1
  1. If it's not already displayed, select your desired organization from the Organizations menu in the navigation bar.

  2. Do one of the following steps:

    • Select Organization Access from the Access Manager menu in the navigation bar.

    • Click Access Manager in the sidebar.

    The Organization Access Manager page displays.

2
3
4

Removing an API Key from an Organization also removes that key from any projects to which the key was granted access.

Back

Get Started