INVITE USER

Syntax

INVITE USER email_address [, ...]
[ WITH (invitation_parameter = value [, ...]) ];

Description

This enables an organization user manager to invite users into an organization. The primary role name assigned to the user is reserved and kept inactive until the user accepts the invitation. If the user rejects the invitation the role is dropped. When you create the invitation you can assign additional roles, as well as a default role, to the user’s primary role.

Only a role with MANAGE_MEMBERS privilege can invite users.

Arguments

email_address

The email address of the user(s) to invite into the current organization.

WITH invitation_parameter = [, ...]

Optionally, this clause specifies Invitation Parameters.

Invitation Parameters

Parameter Name
Description

roles

Specifies a list of additional roles to grant to the user role once the invitation is accepted.

Required: No

Default value: []

Type: List Valid values: See LIST ROLES

default_role

Specifies the role that should be the default login role for the user. Required: Yes Default value: None Type: String Valid values: See LIST ROLES

Example

Invite a new user to an organization with specific roles

INVITE USER 'someone@somewhere.com' WITH (
    'roles' = (a_role, sysadmin),
    'default_role' = sysadmin
);

Invite multiple users to an organization with specific roles

<no-db>/<no-store># INVITE USER 'someone@somewhere.com', 'someone@somewhereelse.com' WITH ('default_role' = sysadmin , 'roles' = (a_role, sysadmin));
+------------+--------------------------------------+----------+------------------------------------------+
|  Type      |  Name                                |  Command |  Summary                                 |
+============+======================================+==========+==========================================+
| invitation | b4f99db5-9d1e-4682-a2b4-940a181b27e1 | CREATE   | invitation for "someone@somewhere.com"   |
|            |                                      |          | was successfully created                 |
+------------+--------------------------------------+----------+------------------------------------------+
| invitation | 89ba9a85-9eef-4795-a84e-70c8480a823f | CREATE   | invitation for                           |
|            |                                      |          | "someone@somewhereelse.com" was          |
|            |                                      |          | successfully created                     |
+------------+--------------------------------------+----------+------------------------------------------+

Last updated