Navigation

mongocli iam team create

The mongocli iam team create command creates a team in the specified organization using the specified profile.

You must have the Organization Owner role to run this command.

mongocli iam team create <team-name>
--username <list-of-usernames>
--orgId <organization-ID>
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
Note

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

Argument
Type
Description
Required?
<team-name>
string
Name of the team you want to create.
yes
Option
Type
Description
Required?
--username
list of strings

Comma-separated list of usernames to add to the new team. Usernames must be valid organization users. A new team must have at least one user.

Note

New users must accept the invitation to join an organization before they can be added to a team.

yes
--orgId
string
Unique identifier of the organization that contains the new team. If omitted, you must have an organization ID defined in your profile.
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 the Go template file

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

no
--profile, -P
string
Name of the profile that contains the access information. If omitted, uses the default profile.
no

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

Team '<team-name>' created.

The following command creates a team called myTeam in an Atlas organization. It uses the default profile for accessing Atlas.

mongocli iam team create myTeam --username user1@example.com,user2@example.com \
--orgId 5df27c15f10fab55fc6c1234 -o json

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

{
"id": "5e44445ef10fab20b49c0f31",
"name": "myTeam",
"usernames": [
"user1@example.com",
"user2@example.com"
]
}
Give Feedback