Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli ops-manager agents apikey delete

On this page

  • Syntax
  • Arguments
  • Options
  • Output
  • Example

The agents apikey delete command deletes one agent API key for the specified Ops Manager project. You must confirm the operation when you run this command without the --force option.

You must have GROUP_OWNER privileges for a project to delete an agent API key from that project.

mongocli ops-manager|om agents apikey|apikeys delete|rm <agent-api-key-id>
[ --force ]
[ --profile|-P <profile-name> ]
[ --projectId <id-of-project> ]
Argument
Type
Description
Required?
<agent-api-key-id>
string
Unique identifier for the agent API key you want to delete.
yes
Option
Type
Description
Required?
--force
Flag that indicates that the agent API key can be deleted without requiring confirmation.
no
--profile, -P
string
Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no

If the command succeeds, it returns the following output in the default format. If the command returns errors, see Troubleshooting for recommended solutions.

? Are you sure you want to delete: <agent-api-key-id> Yes
API Key '<agent-api-key-id>' deleted

The following command deletes one agent API key for a project using the default profile, which contains credentials and the project ID. The output is returned in the default format.

mongocli om agents apikey delete 5f49471dc90220199059861c

The previous command prints the following to the terminal.

? Are you sure you want to delete: 5f49471dc90220199059861c Yes
API Key '5f49471dc90220199059861c' deleted.

Back

Create One Agent API Key