> For the complete documentation index, see [llms.txt](https://docs.deltastream.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.deltastream.io/reference/sql-syntax/command/accept-invitation.md).

# ACCEPT INVITATION

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

```sql
ACCEPT INVITATION invitation_id;
```

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

This command accepts an invitation to join an organization.

To retrieve a list of pending invitations for the authenticated user, use [LIST INVITATIONS](/reference/sql-syntax/command/list-invitations.md).

### Arguments

#### invitation\_id

Specifies the `id` of the invitation to accept.

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

#### Accept the first organization invite

This example shows that when accepting an incoming invitation from someone else's organization, the current session joins that organization and can access the objects granted to the user with the appropriate privileges:

```sh
<no-organization># LIST MY INVITATIONS;
+--------------------------------------+------------+------------------------------------------+
|  ID                                  |  Org Name  |  Invited By                              |
+======================================+============+==========================================+
| bd5b2db3-2f36-49a9-8192-ab6e76fa9290 | demo2      | emailff7192cf-524e-44f5-ae14-17b71ed40ba |
|                                      |            | a@deltastream.io                         |
+--------------------------------------+------------+------------------------------------------+
<no-organization># ACCEPT INVITATION bd5b2db3-2f36-49a9-8192-ab6e76fa9290;
+------------+--------------------------------------+------------+------------------------------------------+
|  Type      |  Name                                |  Command   |  Summary                                 |
+============+======================================+============+==========================================+
| invitation | bd5b2db3-2f36-49a9-8192-ab6e76fa9290 | UPDATE     | invitation to join organization          |
|            |                                      |            | "ecdc3aa3-6b61-49b4-93b6-d855795a1552"   |
|            |                                      |            | was accepted                             |
+------------+--------------------------------------+------------+------------------------------------------+
<no-db>/<no-store># LIST ORGANIZATIONS;
+--------------------------------------+------------+-------------+-------------+--------------+--------------------+-------------------------------+
|  ID                                  |  Name      |  Is Current |  Is Default |  Description |  Profile Image Uri |  Created At                   |
+======================================+============+=============+=============+==============+====================+===============================+
| ecdc3aa3-6b61-49b4-93b6-d855795a1552 | demo2      | true        | true        | <null>       | <null>             | 2024-05-09 04:53:21 +0000 UTC |
+--------------------------------------+------------+-------------+-------------+--------------+--------------------+-------------------------------+
```
