> ## 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 the pending community invitations

To retrieve the list of the community invitations that were sent to the current API user and
were not accepted yet,`getPendingCommunityInvitations` query should be called.
The query result contains pagination and it is possible to change the sorting order and key.
Supports cursor-based (`after`, `before`) or limit-based (`first`, `last`) pagination.

The following arguments can be used in the query:

| Argument  | Type                         | Description                                                                                                                                                                    | Default   |
| :-------- | :--------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------- |
| `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`   |
| `sortKey` | `CommunityInvitationSortKey` | Provides the possibility to change the query sorting key. Available options: `CREATED` (sorting by the invitation creation date) or `NAME` (by the invitee user context name). | `CREATED` |

<CodeGroup>
  ```filename GraphQL theme={null}
    query getPendingCommunityInvitations {
      getPendingCommunityInvitations(first: 1) {
        edges {
          node {
            id
            created
            community {
              id
              title
            }
          }
        }
        totalItems
      }
    }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "getPendingCommunityInvitations": {
        "edges": [
          {
            "node": {
              "id": "2",
              "created": 1757161347,
              "community": {
                "id": "1",
                "title": "Demo community"
              }
            }
          }
        ],
        "totalItems": 1
      }
    }
  }
  ```
</CodeGroup>

The list of nodes in the response contains `CommunityInvatation` object, the full description can be found [here](/OpignoEnterpriseAPI/Community/CreateCommunityInvitation/#community-invitation-object).
