> ## 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 all user's notifications

To get the list of all notifications available for the current API user, a `getNotifications` query should be called.
Results will be returned with the pagination and possibility to change the order (default sorting is by the creation date, ascending).

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 reverse the order of the underlying list (default order is ascending).                                                         | `false` |
| `type`    | `NotificationType`   | Provides a filter by the notification type. Multiple options can be selected.                                                            | —       |
| `status`  | `NotificationStatus` | Allows to filter the results by the notification status. Available options: `READ`, `UNREAD`                                             | —       |

The query returns a list of [`Notification`](/OpignoEnterpriseAPI/Notifications/Notification) objects.

<CodeGroup>
  ```filename GraphQL theme={null}
  query getNotifications {
    getNotifications(first: 20, reverse: true) {
      edges {
        node {
          id
          status
          text
          created
          type
          cta {
            actionId
            arguments {
              key
              value
            }
          }
          relatedEntity {
            __typename
            ... on LearningPath {
              training {
                image {
                  imageStyle(id: IMAGE_200x200) {
                    url
                  }
                }
              }
            }
            ... on Badge {
              picture {
                imageStyle(id: IMAGE_200x200) {
                  url
                }
              }
            }
            ... on Post {
              authorUserContext {
                uuid
              }
            }
            ... on Like {
              userContext {
                uuid
              }
            }
            ... on UserInvitation {
              initiatorUserContext {
                uuid
              }
            }
            ... on UserContext {
              uuid
            }
            ... on Challenge {
              image {
                imageStyle(id: IMAGE_200x200) {
                  url
                }
              }
            }
          }
        }
      }
    }
  }
  ```

  ```File Query result [expandable] theme={null}
    {
      "data": {
        "getNotifications": {
          "edges": [
            {
              "node": {
                "id": 1,
                "status": "UNREAD",
                "text": "Congratulations ! You completed the training Time Management Basics",
                "created": 1769102446,
                "type": "TRAINING_COMPLETED",
                "cta": [
                  {
                    "actionId": "VIEW_LP",
                    "arguments": [
                      {
                        "key": "lpId",
                        "value": "1"
                      }
                    ]
                  }
                ]
                "relatedEntity": {
                  "__typename": "LearningPath",
                  "training": {
                    "image": {
                      "imageStyle": {
                        "url": "https://***.png"
                      }
                    }
                  }
                }
              }
            }
          ]
        }
      }
    }
  ```
</CodeGroup>
