Navigation

mongocli iam organization create

On this page

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.

Syntax

mongocli iam organization|organizations|org|orgs create <organization-name>
     [ --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.

Options

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

Output

The command prints following fields in JSON 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.

Examples

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

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

{
  "id": "abcdefghi123456789",
  "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"
}