Docs Menu
Docs Home
/
MongoDB Atlas
/ / /

Manage Programmatic Access to a Project

On this page

  • Required Access
  • View Programmatic Access to a Project
  • Change Programmatic Access Roles for a Project
  • Edit Project Access List
  • Revoke Programmatic Access to a Project

Use the following procedures to manage programmatic access to a project. To learn more, see Grant Programmatic Access to a Project.

To perform any of the following actions, you must have Project Owner access to the project.

You can view the details of all API keys or service accounts that have access to your 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:

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

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

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

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

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

To view the details of a service account in a project 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. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

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

2
3

All the service accounts with access to your project are listed.

Click the name of a service account to view its details, including:

  • The obfuscated client secret for the service account

  • The date the client secret was last used

  • The date the client secret was created

  • The IP addresses from which the service account can access the API

  • The roles the service account has been assigned

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

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

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

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

  2. Click Edit Permissions.

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

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

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

2
3
4
5
  1. Click Edit Permissions.

  2. From the Project Permissions menu, select the new role or roles for the service account.

  3. Click Save and next.

Important

The service account credentials remain active until they expire or are revoked.

You can use the Atlas Administration API to update service account details for a project.

You can edit the API access list entries for a project API key using atlas organizations commands.

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.

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

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

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

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

  2. Click Edit Permissions.

Note

Selecting Edit Permissions takes you to the organization level of the Atlas console.

5

You cannot modify an existing API Key access list entry. You must delete and re-create it.

  1. Click to the right of the IP address to remove it.

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

  3. Click Save.

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

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

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

2
3
4
5
  1. To add an IP address or CIDR block from which you want Atlas to accept API requests for this service account, 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 service account.

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

  3. Click Save.

You can use the Atlas Administration API to update service account details for 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:

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

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

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

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

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

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

2
3
4
  1. Click the icon under Actions to the right of the service account you want to remove from the project.

  2. Click Remove from this project.

Important

The service account still exists in the organization and any existing credentials remain active until expired or manually revoked.

You can use the Atlas Administration API to remove a service account from a project.

Back

Multiple Organizations