Navigation

mongocli iam globalApiKey delete

The iam globalApiKey delete command deletes the specified Global API Key. You must confirm the operation when you run this command without the --force option. You can also delete a Global API Key using the Ops Manager UI and API.

mongocli iam globalApiKey|globalApiKeys delete|rm <api-key-id>
[ --force ]
[ --profile|-P <profile-name> ]
Note

Use -h or --help to view the command-line help for this command.

Argument
Type
Description
Required?
<api-key-id>
string
Unique identifier of the Global API Key to delete.
yes
Option
Type
Description
Required?
--force
Flag that indicates that the API key can be deleted without requiring confirmation.
no
--profile, -P
string

Name of the profile where your credentials are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.

You must have credentials with the Global Owner role to delete a Global API Key.

no

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

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

The following command deletes the specified Global API Key with confirmation. The command uses the default profile, which contains credentials for accessing the Ops Manager instance.

mongocli iam globalApiKey delete 5f3d8790c9022019903c1234

The previous command prints the following to the terminal.

? Are you sure you want to delete: 5f3d8790c9022019903c1234 Yes
API Key '5f3d8790c9022019903c1234' deleted
Give Feedback