Navigation

mongocli iam team user add

The mongocli iam team user add command adds one or more users to a team in the specified organization using the specified profile. Users must be current members of an organization before joining a team.

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

mongocli iam team user add <user-IDs>
--teamId <team-ID>
--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?
<user-IDs>
list of strings
List of user IDs to add to the specified team.
yes
Option
Type
Description
Required?
--teamId
string
Unique identifier of the team to which you want to add users.
yes
--orgId
string
Unique identifier of the organization that contains the team.
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.

User(s) added to the team.

The following command adds two new users to a Atlas organization. It uses the default profile for accessing Atlas.

mongocli iam team user add 5dd58c647a3e5a6c5bce46c7 5dd56c847a3e5a1f363d424d \
--teamId 5f6a5c6c713184005d72fe6e --orgId 5df27c15f10fab55fc6c1234

The previous command prints the following in the default format to the terminal.

User(s) added to the team.
Give Feedback