# INVITE USER

## Syntax <a href="#synopsis" id="synopsis"></a>

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

## Description <a href="#description" id="description"></a>

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](https://docs.deltastream.io/overview/core-concepts/access-control#_role) with [MANAGE\_MEMBERS](https://docs.deltastream.io/overview/core-concepts/access-control#_privilege) 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 [#store\_parameters](#store_parameters "mention").

### Invitation Parameters <a href="#store_parameters" id="store_parameters"></a>

<table><thead><tr><th width="393">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td><code>roles</code></td><td><p>Specifies a list of additional roles to grant to the user role once the invitation is accepted.</p><p><br><strong>Required:</strong> No</p><p><strong>Default value:</strong> []</p><p><strong>Type:</strong> List<br><strong>Valid values:</strong> See <a data-mention href="list-roles">list-roles</a></p></td></tr><tr><td><code>default_role</code></td><td>Specifies the role that should be the default login role for the user.<br><br><strong>Required:</strong> Yes<br><strong>Default value:</strong> None<br><strong>Type:</strong> String<br><strong>Valid values:</strong> See <a data-mention href="list-roles">list-roles</a></td></tr></tbody></table>

## Example <a href="#example" id="example"></a>

#### Invite a new user to an organization with specific roles

<pre class="language-sh"><code class="lang-sh"><strong>INVITE USER 'someone@somewhere.com' WITH (
</strong>    'roles' = (a_role, sysadmin),
    'default_role' = sysadmin
);
</code></pre>

#### Invite multiple users to an organization with specific roles

```sh
<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                     |
+------------+--------------------------------------+----------+------------------------------------------+
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.deltastream.io/reference/sql-syntax/command/invite-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
