---
title: "Get notifications (getNotifications)"
method: GET
path: "/api/notifications"
tags: ["notification-controller"]
---

# Get notifications (getNotifications)

`GET /api/notifications`

Returns the page of notifications for current user.

You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. 

Available for any authorized user. 

**WebSocket API**:

There are 2 types of subscriptions: one for unread notifications count, another for unread notifications themselves.

The URI for opening WS session for notifications: `/api/ws/plugins/notifications`.

Subscription command for unread notifications count:
```
{
  "unreadCountSubCmd": {
    "cmdId": 1234
  }
}
```
To subscribe for latest unread notifications:
```
{
  "unreadSubCmd": {
    "cmdId": 1234,
    "limit": 10
  }
}
```
To unsubscribe from any subscription:
```
{
  "unsubCmd": {
    "cmdId": 1234
  }
}
```
To mark certain notifications as read, use following command:
```
{
  "markAsReadCmd": {
    "cmdId": 1234,
    "notifications": [
      "6f860330-7fc2-11ed-b855-7dd3b7d2faa9",
      "5b6dfee0-8d0d-11ed-b61f-35a57b03dade"
    ]
  }
}

```
To mark all notifications as read:
```
{
  "markAllAsReadCmd": {
    "cmdId": 1234
  }
}
```


Update structure for unread **notifications count subscription**:
```
{
  "cmdId": 1234,
  "totalUnreadCount": 55
}
```
For **notifications subscription**:
- full update of latest unread notifications:
```
{
  "cmdId": 1234,
  "notifications": [
    {
      "id": {
        "entityType": "NOTIFICATION",
        "id": "6f860330-7fc2-11ed-b855-7dd3b7d2faa9"
      },
      ...
    }
  ],
  "totalUnreadCount": 1
}
```
- when new notification arrives or shown notification is updated:
```
{
  "cmdId": 1234,
  "update": {
    "id": {
      "entityType": "NOTIFICATION",
      "id": "6f860330-7fc2-11ed-b855-7dd3b7d2faa9"
    },
    # updated notification info, text, subject etc.
    ...
  },
  "totalUnreadCount": 2
}
```
- when unread notifications count changes:
```
{
  "cmdId": 1234,
  "totalUnreadCount": 5
}
```

## Query parameters

- `pageSize` integer, required
- `page` integer, required
- `textSearch` string
- `sortProperty` string
- `sortOrder` string
- `unreadOnly` boolean
- `deliveryMethod` 'WEB' | 'MOBILE_APP'

## Response `200`

OK

- PageDataNotification
  - `data` Notification[] — Array of the entities
    - `requestId` NotificationRequestId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'NOTIFICATION_REQUEST', required — string
    - `recipientId` UserId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'USER', required — string
    - `type` 'GENERAL' | 'ALARM' | 'DEVICE_ACTIVITY' | 'ENTITY_ACTION' | 'ALARM_COMMENT' | 'RULE_ENGINE_COMPONENT_LIFECYCLE_EVENT' | 'ALARM_ASSIGNMENT' | 'NEW_PLATFORM_VERSION' | 'ENTITIES_LIMIT' | 'ENTITIES_LIMIT_INCREASE_REQUEST' | 'API_USAGE_LIMIT' | 'RULE_NODE' | 'RATE_LIMITS' | 'EDGE_CONNECTION' | 'EDGE_COMMUNICATION_FAILURE' | 'TASK_PROCESSING_FAILURE' | 'RESOURCES_SHORTAGE'
    - `deliveryMethod` 'WEB' | 'EMAIL' | 'SMS' | 'SLACK' | 'MICROSOFT_TEAMS' | 'MOBILE_APP'
    - `subject` string
    - `text` string
    - `additionalConfig` unknown
    - `info` NotificationInfo
      - `dashboardId` DashboardId
        - `id` string, uuid, required — ID of the entity, time-based UUID v1
        - `entityType` 'DASHBOARD', required — string
      - `stateEntityId` EntityId
        - `id` string, uuid, required — ID of the entity, time-based UUID v1
        - `entityType` 'TENANT' | 'CUSTOMER' | 'USER' | 'DASHBOARD' | 'ASSET' | 'DEVICE' | 'ALARM' | 'RULE_CHAIN' | 'RULE_NODE' | 'ENTITY_VIEW' | 'WIDGETS_BUNDLE' | 'WIDGET_TYPE' | 'TENANT_PROFILE' | 'DEVICE_PROFILE' | 'ASSET_PROFILE' | 'API_USAGE_STATE' | 'TB_RESOURCE' | 'OTA_PACKAGE' | 'EDGE' | 'RPC' | 'QUEUE' | 'NOTIFICATION_TARGET' | 'NOTIFICATION_TEMPLATE' | 'NOTIFICATION_REQUEST' | 'NOTIFICATION' | 'NOTIFICATION_RULE' | 'QUEUE_STATS' | 'OAUTH2_CLIENT' | 'DOMAIN' | 'MOBILE_APP' | 'MOBILE_APP_BUNDLE' | 'CALCULATED_FIELD' | 'JOB' | 'ADMIN_SETTINGS' | 'AI_MODEL' | 'API_KEY', required
      - `type` string, required
    - `status` 'SENT' | 'READ'
    - `id` NotificationId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'NOTIFICATION', required — string
    - `createdTime` integer — Entity creation timestamp in milliseconds since Unix epoch
  - `totalPages` integer — Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria
  - `totalElements` integer — Total number of elements in all available pages
  - `hasNext` boolean — 'false' value indicates the end of the result set

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
