Docs Menu
Docs Home
/ /
Atlas CLI
/ / /

atlas organizations invitations invite

Invite the specified MongoDB user to your organization.

Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link.

To use this command, you must authenticate with a user account or an API key with the Organization User Admin role.

Command Syntax
atlas organizations invitations invite <email> [options]
Name
Type
Required
Description

email

string

true

Email address that belongs to the user that you want to invite to the organization.

Name
Type
Required
Description

-f, --file

string

false

Path to an optional JSON configuration file that defines invitation settings. Note: Unsupported fields in the JSON file are ignored.

Mutually exclusive with --role, --teamId.

-h, --help

false

help for invite

--orgId

string

false

Organization ID to use. This option overrides the settings in the configuration file or environment variable.

-o, --output

string

false

Output format. Valid values are json, json-path, go-template, or go-template-file. To see the full output, use the -o json option.

--role

strings

false

User's roles for the associated organization. Valid values include ORG_OWNER, ORG_MEMBER, ORG_GROUP_CREATOR, ORG_BILLING_ADMIN, and ORG_READ_ONLY.

Mutually exclusive with --file.

--teamId

strings

false

Unique 24-digit string that identifies the team.

Mutually exclusive with --file.

Name
Type
Required
Description

-P, --profile

string

false

If the command succeeds, the CLI returns output similar to the following sample. Values in brackets represent your values.

User '<Username>' invited.
# Invite the MongoDB user with the email user@example.com to the organization with the ID 5f71e5255afec75a3d0f96dc with ORG_OWNER access:
atlas organizations invitations invite user@example.com --orgId 5f71e5255afec75a3d0f96dc --role ORG_OWNER --output json

Back

describe

On this page