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

mongocli iam organization delete

On this page

  • Syntax
  • Options
  • Output
  • Examples

The mongocli iam organization delete command deletes an organization in your Ops Manager instance.

To run this command you must have the following permissions based on your API Key type:

API Key Type
Role
Global API Keys
Global Owner
Personal API Keys
Organization Owner
mongocli iam organization|organizations|org|orgs delete|rm <organization-id>
[ --force ]
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]

Note

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

Option
Type
Description
Required?
--force
Flag that indicates that the organization can be deleted without requiring confirmation.
no
<organization-ID>
string
Unique identifier of the organization you want to delete.
yes
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string

Name of the profile where your credentials are saved.

Your credentials can either be a Global API key pair or a Personal API key.

If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.

no

The command prints following fields in the specified format to the terminal if the command succeeds. If the command returns errors, see Troubleshooting for recommended solutions.

Organization '<organization-id>' deleted

The following command deletes an organization with the ID 5e33545ef10fab20b49c0f3b in an Ops Manager instance. The command uses the default profile, which contains API keys that have the Global Owner role.

mongocli iam organization delete 5e33545ef10fab20b49c0f3b

The previous command prints the following to the terminal. For more information on these fields, see Output.

? Are you sure you want to delete: 5e33545ef10fab20b49c0f3b Yes
Organization '5e33545ef10fab20b49c0f3b' deleted

The following command deletes an organization without requiring confirmation. The command uses the default profile, which contains API keys that have the Global Owner role.

mongocli iam organization delete 9dj3545ef10fab20b49c0f3b --force

The previous command prints the following to the terminal:

Organization '9dj3545ef10fab20b49c0f3b' deleted

Back

Describe an Organization