> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get possible community invitees

Community owner and members can invite other users from their network to the community.
To get the list of possible invitees, `getPossibleCommunityInvitees` should be used.

<Note>
  Members can invite other users **only** to the public communities.

  Users associated with the `ADMINISTRATOR` scope can invite any other user who is not a member of the community yet.
</Note>

The query returns the list of user contexts who can be invited to join the given community.
Results will be returned with pagination and sorted by the name (ascending by default, the order can be reversed).

The following arguments can be used in the query:

| Argument      | Type      | Description                                                                                                                                                                                | Default |
| :------------ | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ |
| `communityId` | `ID`      | **Required**. ID of the community to get the list of the user contexts who can be invited to.                                                                                              | —       |
| `after`       | `Cursor`  | Returns results that come after the specified cursor. Should be used together with `first` parameter. Cannot be used if `before` is set.                                                   | —       |
| `before`      | `Cursor`  | Returns results that come before the specified cursor. Should be used together with `last` parameter. Cannot be used if `after` is set.                                                    | —       |
| `first`       | `Integer` | Returns up to the first N elements from the list. Required if `after` parameter is set. Cannot be used together with `last`.                                                               | —       |
| `last`        | `Integer` | Returns up to the first N elements from the list. Required if `before` parameter is set. Cannot be used together with `first`.                                                             | —       |
| `reverse`     | `Boolean` | Allows to change the order of the sorting to `DESC`.                                                                                                                                       | `false` |
| `name`        | `String`  | Provides the possibility to filter by the user context name. **Note:** it makes sense only if the real user name is sent to Opigno Enterprise API during the user context synchronization. | —       |

<CodeGroup>
  ```filename GraphQL theme={null}
    query getPossibleCommunityInvitees {
      getPossibleCommunityInvitees(communityId: 3, first: 2) {
        edges {
          node {
            id
            displayName
            uuid
          }
        }
        totalItems
      }
    }
  ```

  ```File Query result [expandable] theme={null}
    {
      "data": {
        "getPossibleCommunityInvitees": {
          "edges": [
            {
              "node": {
                  "id": "1904",
                  "displayName": "John Smith"
                  "uuid": "bdb5d2e4-35a0-4147-a2b5-58e439696806",
              }
            },
          "totalItems": 1
        }
      }
    }
  ```
</CodeGroup>

For every returned user context [`createCommunityInvitation`](/OpignoEnterpriseAPI/Community/CreateCommunityInvitation) mutation can be executed.
