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


---

# 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/accept-invitation.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.
