Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.
This version of the manual is no longer supported.

Programmatic Access to Ops Manager

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 Ops Manager.
  • Cannot be used to log into Ops Manager 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

Required Permissions

To perform any of the following actions, you must have the Organization Owner role.

Create an API Key in an Organization

  1. From the Context menu, select the organization that you want to view.

  2. Click Access.

  3. Click the tab for API Keys.

  4. Select Create API Key from the Manage button menu.

  5. From the API Key Information step of the Add API Key page, enter a description for the new API Key in the Description box.

  6. Select the new role or roles for the API Key from the Organization Permissions menu.

  7. Click Next.

  8. From the Private Key & Whitelist step of the Add API Key page, click Add Whitelist Entry.

  9. Enter an IPv4 address from which you want Ops Manager to accept API requests for this API Key.

    You can also click Use Current IP Address if the host you are using to access Ops Manager also will make API requests using this API Key.

  10. Click Save.

    Copy the Private Key Before Leaving this Page

    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 this Private Key as you would any other password.

View the Details of an API Key in an Organization

  1. From the Context menu, select the organization that you want to view.

  2. Click Access.

  3. Click the tab for API Keys to see the available keys.

  4. From the ellipsis menu 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 IPv4 addresses on which the key is whitelisted
    • The projects to which the Key has been granted access

Change an API Key in an Organization

You can change the roles, description, or whitelist of an API Key in an Organization.

  1. From the Context menu, select the organization that you want to view.

  2. Click Access.

  3. Click the tab for API Keys to see the available keys.

  4. From the ellipsis menu to the right of the API Key you want to change, click Edit.

  5. From the API Key Information step of the Add API Key page, you can change the description of the API Key in the Description box.

  6. You can change existing or add new roles to the API Key from the Organization Permissions menu.

  7. Click Next.

  8. From the Private Key & Whitelist step of the Add API Key page, you can add or remove an IP address to the whitelist.

    • To add an IP address from which you want Ops Manager to accept API requests for this API Key, click Add Whitelist Entry and type an IPv4 address.

      You can also click Use Current IP Address if the host you are using to access Ops Manager also will make API requests using this API Key.

    • To remove a whitelisted IP address, click trash icon to the right of the whitelisted IP address.

  9. Click Save.

Delete an API Key from an Organization

  1. From the Context menu, select the organization that you want to view.

  2. Click Access.

  3. Click the tab for API Keys to see the available keys.

  4. Click trash icon to the right of the API Key that you want to delete.

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

Required Permissions

To perform any of the following actions, you must have either the Project User Admin role.

Create an API Key for a Project

  1. From the Context menu, select the project that you want to view.

  2. Click Access.

  3. Click the tab for API Keys.

  4. Select Create API Key from the Manage button menu.

  5. From the API Key Information step of the Add API Key page, enter a description for the new API Key in the Description box.

  6. Select the new role or roles for the API Key from the Project Permissions menu.

  7. Click Next.

  8. From the Private Key & Whitelist step of the Add API Key page, click Add Whitelist Entry.

  9. Enter an IPv4 address from which you want Ops Manager to accept API requests for this API Key.

    You can also click Use Current IP Address if the host you are using to access Ops Manager also will make API requests using this API Key.

  10. Click Save.

    Copy the Private Key Before Leaving this Page

    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 this Private Key as you would any other password.

View the Details of an API Key in a Project

  1. From the Context menu, select the project that you want to view.

  2. Click Access.

  3. Click the tab for API Keys to see the available keys.

  4. From the ellipsis menu 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 it was created, and the IPv4 addresses on which the key is whitelisted.

Change an API Key’s Roles in a Project

  1. From the Context menu, select the project that you want to view.
  2. Click Access.
  3. Click the tab for API Keys to see the available keys.
  4. From the ellipsis menu to the right of the API Key, click Edit Permissions.
  5. Select the new role or roles for the API Key from the menu.
  6. Click on the checkmark to save.

Delete an API Key from a Project

  1. From the Context menu, select the project that you want to view.
  2. Click Access.
  3. Click the tab for API Keys to see the available keys.
  4. Click trash icon to the right of the API Key.