|
| 1 | +.. _iam-user-invite: |
| 2 | + |
| 3 | +======================== |
| 4 | +mongocli iam user invite |
| 5 | +======================== |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 1 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +The ``mongocli iam user invite`` command invites |
| 16 | +the specified users to join the specified organization or project. |
| 17 | +You can also invite users to: |
| 18 | + |
| 19 | +- |service| using the UI for your :atlas:`organization |
| 20 | + </access/manage-org-users/>` or :atlas:`project |
| 21 | + </access/manage-project-access/#add-users-or-teams-to-a-project>` and |
| 22 | + using the :atlas:`API </reference/api/user-create/>`. |
| 23 | +- |cloud-short| using the UI for your :cloudmgr:`organization |
| 24 | + </tutorial/manage-users/#manage-user-access-to-an-organization>` or |
| 25 | + :cloudmgr:`project </tutorial/manage-users/#add-users-or-teams-to-a-project>` |
| 26 | + and using the :cloudmgr:`API </reference/api/user-create/>`. |
| 27 | +- |onprem| using the UI for your :opsmgr:`organization |
| 28 | + </tutorial/manage-users/#add-users-to-mms>` or :opsmgr:`project |
| 29 | + </tutorial/manage-users/#add-users-or-teams-to-a-project>` and using the |
| 30 | + :opsmgr:`API </reference/api/user-create/>`. |
| 31 | + |
| 32 | +The user must accept your invitation to join the project or |
| 33 | +organization. |
| 34 | + |
| 35 | +.. _mcli-iam-user-invite-cmd-permissions: |
| 36 | + |
| 37 | +Permissions Required |
| 38 | +-------------------- |
| 39 | + |
| 40 | +The following tables shows the roles you must have to invite |
| 41 | +users to your MongoDB service organization or project: |
| 42 | + |
| 43 | +.. list-table:: |
| 44 | + :header-rows: 1 |
| 45 | + :widths: 30 35 35 |
| 46 | + |
| 47 | + * - MongoDB Service |
| 48 | + - Organization |
| 49 | + - Project |
| 50 | + |
| 51 | + * - |service| |
| 52 | + - :atlas:`Organization Owner </reference/user-roles/#Organization-Owner>` |
| 53 | + role |
| 54 | + - :atlas:`Project Owner </reference/user-roles/#Project-Owner>` role |
| 55 | + |
| 56 | + * - |cloud-short| |
| 57 | + - :cloudmgr:`Organization Owner |
| 58 | + </reference/user-roles/#Organization-Owner>` role |
| 59 | + - - :cloudmgr:`Project User Admin |
| 60 | + </reference/user-roles/#Project-User-Admin>` role or, |
| 61 | + - :cloudmgr:`Project Owner </reference/user-roles/#Project-Owner>` role |
| 62 | + |
| 63 | + * - |onprem| |
| 64 | + - :opsmgr:`Organization Owner </reference/user-roles/#Organization-Owner>` |
| 65 | + role |
| 66 | + - - :opsmgr:`Project User Admin |
| 67 | + </reference/user-roles/#Project-User-Admin>` role or, |
| 68 | + - :opsmgr:`Project Owner </reference/user-roles/#Project-Owner>` role |
| 69 | + |
| 70 | +.. _mcli-iam-user-invite-syntax: |
| 71 | + |
| 72 | +Syntax |
| 73 | +------ |
| 74 | + |
| 75 | +.. code-block:: text |
| 76 | + |
| 77 | + mongocli iam user invite |
| 78 | + --country <country-code-of-user> |
| 79 | + --email <email-address-of-user> |
| 80 | + --firstName <first-name-of-user> |
| 81 | + --lastName <last-name-of-user> |
| 82 | + [ --mobile <mobile-number-of-user> ] |
| 83 | + [ --orgRole <org-role-of-user> ] |
| 84 | + [ --output|-o <output-format> ] |
| 85 | + --password <password-of-user> |
| 86 | + [ --profile|-P <profile-name> ] |
| 87 | + [ projectRole <project-role-of-user> ] |
| 88 | + --username <username-of-user> |
| 89 | + |
| 90 | +.. include:: /includes/fact-command-line-help.rst |
| 91 | + |
| 92 | +.. _mcli-iam-user-invite-options: |
| 93 | + |
| 94 | +Options |
| 95 | +------- |
| 96 | + |
| 97 | +.. list-table:: |
| 98 | + :header-rows: 1 |
| 99 | + :widths: 20 10 60 10 |
| 100 | + |
| 101 | + * - Option |
| 102 | + - Type |
| 103 | + - Description |
| 104 | + - Required? |
| 105 | + |
| 106 | + * - ``--country`` |
| 107 | + - string |
| 108 | + - Primary country where the user is based. Must match a |
| 109 | + two-letter `ISO 3661-1 <https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements>`__ |
| 110 | + country code. |
| 111 | + - - yes for |service| |
| 112 | + - yes for |cloud-short| |
| 113 | + - no for |onprem| |
| 114 | + |
| 115 | + * - ``--email`` |
| 116 | + - string |
| 117 | + - Email address of the user. |
| 118 | + - yes |
| 119 | + |
| 120 | + * - ``--firstName`` |
| 121 | + - string |
| 122 | + - First name of the user. |
| 123 | + - yes |
| 124 | + |
| 125 | + * - ``--lastName`` |
| 126 | + - string |
| 127 | + - Last name of the user. |
| 128 | + - yes |
| 129 | + |
| 130 | + * - ``--mobile`` |
| 131 | + - string |
| 132 | + - Mobile telephone number of the user. |
| 133 | + - no |
| 134 | + |
| 135 | + * - ``--orgRole`` |
| 136 | + - string |
| 137 | + - Name of the organization role to assign to the user. For the |
| 138 | + list of valid organization roles for your MongoDB service, see: |
| 139 | + |
| 140 | + - :atlas:`Atlas </reference/user-roles/#organization-roles>` |
| 141 | + - :cloudmgr:`Cloud Manager </reference/user-roles/#organization-member-role>` |
| 142 | + - :opsmgr:`Ops Manager </reference/user-roles/#organization-member-role>` |
| 143 | + |
| 144 | + If omitted, user is granted the following role for your |
| 145 | + MongoDB service: |
| 146 | + |
| 147 | + - :atlas:`Organization Member |
| 148 | + </reference/user-roles/#Organization-Member>` role on |service|. |
| 149 | + - :cloudmgr:`Organization Member |
| 150 | + </reference/user-roles/#Organization-Member>` role on |cloud-short|. |
| 151 | + - :opsmgr:`Organization Member |
| 152 | + </reference/user-roles/#Organization-Member>` role on |onprem|. |
| 153 | + |
| 154 | + - no |
| 155 | + |
| 156 | + * - ``--output``, ``-o`` |
| 157 | + - string |
| 158 | + - .. include:: /includes/extracts/fact-basic-options-output.rst |
| 159 | + - no |
| 160 | + |
| 161 | + * - ``--password`` |
| 162 | + - string |
| 163 | + - Password of the user. |
| 164 | + - yes |
| 165 | + |
| 166 | + * - ``--profile``, ``-P`` |
| 167 | + - string |
| 168 | + - Name of the profile that contains the access information. If |
| 169 | + omitted, uses the {+default-profile+}. |
| 170 | + - no |
| 171 | + |
| 172 | + * - ``--projectRole`` |
| 173 | + - string |
| 174 | + - Name of the project role to assign to the user. For the |
| 175 | + list of valid project roles for your MongoDB service, see: |
| 176 | + |
| 177 | + - :atlas:`Atlas </reference/user-roles/#project-roles>` |
| 178 | + - :cloudmgr:`Cloud Manager </reference/user-roles/#user-admin-role>` |
| 179 | + - :opsmgr:`Ops Manager </reference/user-roles/#user-admin-role>` |
| 180 | + |
| 181 | + If omitted, user is granted the following role for your |
| 182 | + MongoDB service: |
| 183 | + |
| 184 | + - :atlas:`Organization Member |
| 185 | + </reference/user-roles/#Organization-Member>` role on |service|. |
| 186 | + - :cloudmgr:`Project Member </reference/user-roles/#project-roles>` |
| 187 | + role on |cloud-short|. |
| 188 | + - :opsmgr:`Project Member </reference/user-roles/#project-roles>` |
| 189 | + role on |onprem|. |
| 190 | + |
| 191 | + - no |
| 192 | + |
| 193 | + * - ``--username`` |
| 194 | + - string |
| 195 | + - Username of the user. Value must be a valid email address. |
| 196 | + - yes |
| 197 | + |
| 198 | +.. _mcli-iam-user-invite-output: |
| 199 | + |
| 200 | +Output |
| 201 | +------ |
| 202 | + |
| 203 | +The command prints the following to the terminal if the command succeeds. |
| 204 | +If the command prints an error, see :ref:`Troubleshooting <mcli-troubleshooting>` for recommended solutions. |
| 205 | + |
| 206 | +.. code-block:: none |
| 207 | + :copyable: false |
| 208 | + |
| 209 | + The user '<username>' has been invited. |
| 210 | + Invited users do not have access to the project until they accept the invitation. |
| 211 | + |
| 212 | +The above default output is a subset of the fields returned by this command. |
| 213 | +For the complete list of |json| fields returned by the command, see the |
| 214 | +API reference for your MongoDB service: |
| 215 | + |
| 216 | +- :atlas:`Atlas </reference/api/user-create/#response>` |
| 217 | +- :cloudmgr:`Cloud Manager </reference/api/user-create/#response>` |
| 218 | +- :opsmgr:`Ops Manager </current/reference/api/user-create/#response>` |
| 219 | + |
| 220 | +.. _mcli-iam-user-invite-examples: |
| 221 | + |
| 222 | +Example |
| 223 | +------- |
| 224 | + |
| 225 | +.. tabs:: |
| 226 | + |
| 227 | + .. tab:: Default |
| 228 | + :tabid: default |
| 229 | + |
| 230 | + The following command invites a new user to an |onprem| organization. It |
| 231 | + uses the {+default-profile+} for accessing |onprem|. |
| 232 | + |
| 233 | + .. code-block:: text |
| 234 | + |
| 235 | + mongocli iam users invite --username [email protected] --password changeMe --email [email protected] --firstName john --lastName doe |
| 236 | + |
| 237 | + The previous command prints the following in the default format to |
| 238 | + the terminal. |
| 239 | + |
| 240 | + .. code-block:: none |
| 241 | + :copyable: false |
| 242 | + |
| 243 | + The user ' [email protected]' has been invited. |
| 244 | + Invited users do not have access to the project until they accept the |
| 245 | + invitation. |
| 246 | + |
| 247 | + .. tab:: JSON |
| 248 | + :tabid: json |
| 249 | + |
| 250 | + The following command invites a new user to an |service| organization. It |
| 251 | + uses the {+default-profile+} for accessing |service|. |
| 252 | + |
| 253 | + .. code-block:: text |
| 254 | + |
| 255 | + mongocli iam users invite --username [email protected] --password changeMe --email [email protected] --firstName john --lastName doe --country US -o json |
| 256 | + |
| 257 | + The previous command prints the following in the default format to |
| 258 | + the terminal. |
| 259 | + |
| 260 | + .. code-block:: none |
| 261 | + :copyable: false |
| 262 | + |
| 263 | + { |
| 264 | + "emailAddress": " [email protected]", |
| 265 | + "firstName": "john", |
| 266 | + "id": "5f71e5255afec75a3d0f96dc", |
| 267 | + "lastName": "doe", |
| 268 | + "roles": [], |
| 269 | + |
| 270 | + "mobileNumber": "", |
| 271 | + "password": "", |
| 272 | + "country": "US" |
| 273 | + } |
0 commit comments