> ## 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 list of user sent invitations

To retrieve the list of the user invitations created by the user context associated with the current API account,
`getUserSentInvitations` query should be called.

The query returns the list of invitations that have been sent to the current user (fetched from the request) and are not accepted yet.
The data contains pagination and sorting options. Supports cursor-based pagination (`after`, `before`) or limit-based (`first`, `last`).

The same pagination approach as in other queries is used (for example, [getCatalogData](/OpignoEnterpriseAPI/PaginatingCatalogItems)).

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

<CodeGroup>
  ```filename GraphQL theme={null}
    query getUserSentInvitations {
      getUserSentInvitations(first: 1) {
        edges {
          node {
            inviteeUserContext {
              id
              uuid
            }
            cta {
              actionId
              title
              arguments {
                key
                value
              }
              metadata {
                key
                value
              }
            }
          }
        }
        pageInfo {
          hasNextPage
          startCursor
          endCursor
        }
        totalItems
      }
    }
  ```

  ```File Query result [expandable] theme={null}
    {
      "data": {
        "getUserSentInvitations": {
          "edges": [
            {
              "node": {
                "inviteeUserContext": {
                  "id": "1013",
                  "uuid": "14e2146f-6aa2-4be8-9da6-97c159f99bef",
                },
                "cta": [
                  {
                    "actionId": "CANCEL_USER_INVITATION",
                    "title": "Cancel",
                    "arguments": [
                      {
                        "key": "invitationId",
                        "value": "49"
                      }
                    ],
                    "metadata": [
                      {
                        "key": "type",
                        "value": "button"
                      }
                    ]
                  },
                ]
              }
            },
          ],
          "pageInfo": {
            "hasNextPage": false,
            "startCursor": "TzozMzoiRHJ1cGFsXG9waWdub19hcGlcV3JhcHBlcnNcQ3Vyc29yIjo0OntzOjE0OiIAKgBiYWNraW5nVHlwZSI7czoyMjoib3BpZ25vX3VzZXJfY29ubmVjdGlvbiI7czoxMjoiACoAYmFja2luZ0lkIjtpOjYwO3M6MTA6IgAqAHNvcnRLZXkiO3M6NzoiQ1JFQVRFRCI7czoxMjoiACoAc29ydFZhbHVlIjtpOjE3NTE2MzI4MjQ7fQ==",
            "endCursor": "TzozMzoiRHJ1cGFsXG9waWdub19hcGlcV3JhcHBlcnNcQ3Vyc29yIjo0OntzOjE0OiIAKgBiYWNraW5nVHlwZSI7czoyMjoib3BpZ25vX3VzZXJfY29ubmVjdGlvbiI7czoxMjoiACoAYmFja2luZ0lkIjtpOjYwO3M6MTA6IgAqAHNvcnRLZXkiO3M6NzoiQ1JFQVRFRCI7czoxMjoiACoAc29ydFZhbHVlIjtpOjE3NTE2MzI4MjQ7fQ=="
          },
          "totalItems": 3
        }
      }
    }
  ```
</CodeGroup>

The list of nodes in the response contains `UserInvatation` object, the full example can be found [here](/OpignoEnterpriseAPI/UserConnection/CreateUserInvitation).
