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

mongocli iam organization create

On this page

  • Syntax
  • Options
  • Output
  • Examples

The mongocli iam organization create command creates a new Cloud Manager or Ops Manager organization.

You must have the Global Owner role to create an organization.

mongocli iam organization|organizations|org|orgs create <organization-name>
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]

Important

The service for which the organization is created is determined by your profile.

Note

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

Option
Type
Description
Required?
--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.

You must have credentials with the Global Owner role to create an organization. You can use either a Global API key pair or a Personal API key:

Credential Type
public_api_key Value
private_api_key Value
Global API Keys
Public Global API key
Private Global API key
Personal API Key
Cloud Manager or Ops Manager username
Personal API key

The profile must include a service value of either:

  • "ops-manager" for an Ops Manager organization, or

  • "cloud-manager" for a Cloud Manager organization.

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.

Field
Description
id
Unique identifier of the organization.
links
One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
name
Name of the organization.

The following command creates an Ops Manager organization called myOrg using the default profile, which contains the Global Owner credentials and specifies the Ops Manager service:

mongocli iam organization create myOrg --output json

The previous command creates the Ops Manager organization myOrg and prints the following in the specified format to the terminal. For more information on these fields, see Output.

{
"id": "abcdefghi123456789",
"isDeleted": false,
"links": [
{
"rel": "self",
"href": "www.example.com:8080/api/public/v1.0/orgs/abcdefghi123456789"
},
{
"rel": "http://mms.mongodb.com/groups",
"href": "www.example.com:8080/api/public/v1.0/orgs/abcdefghi123456789/groups"
},
{
"rel": "http://mms.mongodb.com/teams",
"href": "www.example.com:8080/api/public/v1.0/orgs/abcdefghi123456789/teams"
},
{
"rel": "http://mms.mongodb.com/users",
"href": "www.example.com:8080/api/public/v1.0/orgs/abcdefghi123456789/users"
}
],
"name": "myOrg"
}

Back

Organizations