{
  "opencollection": "1.0.0",
  "info": {
    "name": "ThingsBoard Notifications API",
    "version": "4.3.0.3DEMO"
  },
  "items": [
    {
      "info": {
        "name": "notification-controller",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Mark All Notifications as Read (markAllNotificationsAsRead)",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://demo.thingsboard.io/api/notifications/read",
            "params": [
              {
                "name": "deliveryMethod",
                "value": "",
                "type": "query",
                "description": "Delivery method"
              }
            ]
          },
          "docs": "Marks all unread notifications as read.\n\nAvailable for any authorized user. "
        },
        {
          "info": {
            "name": "Mark Notification as Read (markNotificationAsRead)",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://demo.thingsboard.io/api/notification/:id/read",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Marks notification as read by its id.\n\nAvailable for any authorized user. "
        },
        {
          "info": {
            "name": "Get Notification Settings (getNotificationSettings)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/settings"
          },
          "docs": "Retrieves notification settings for this tenant or sysadmin.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Save Notification Settings (saveNotificationSettings)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/settings",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Saves notification settings for this tenant or sysadmin.\n`deliveryMethodsConfigs` of the settings must be specified.\n\nHere is an example of the notification settings with Slack configuration:\n```json\n{\n  \"deliveryMethodsConfigs\": {\n    \"SLACK\": {\n      \"method\": \"SLACK\",\n      \"botToken\": \"xoxb-....\"\n    }\n  }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "getUserNotificationSettings",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/settings/user"
          }
        },
        {
          "info": {
            "name": "saveUserNotificationSettings",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/settings/user",
            "body": {
              "type": "json",
              "data": "{}"
            }
          }
        },
        {
          "info": {
            "name": "Create Notification Request (createNotificationRequest)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/request",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Processes notification request.\nMandatory request properties are `targets` (list of targets ids to send notification to), and either `templateId` (existing notification template id) or `template` (to send notification without saving the template).\nOptionally, you can set `sendingDelayInSec` inside the `additionalConfig` field to schedule the notification.\n\nFor each enabled delivery method in the notification template, there must be a target in the `targets` list that supports this delivery metho"
        },
        {
          "info": {
            "name": "Get Notification Request Preview (getNotificationRequestPreview)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/request/preview",
            "params": [
              {
                "name": "recipientsPreviewSize",
                "value": "",
                "type": "query",
                "description": "Amount of the recipients to show in preview"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Returns preview for notification request.\n\n`processedTemplates` shows how the notifications for each delivery method will look like for the first recipient of the corresponding notification target.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Send Entity Limit Increase Request Notification to System Administrators (sendEntitiesLimitIncreaseRequest)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/entitiesLimitIncreaseRequest/:entityType",
            "params": [
              {
                "name": "entityType",
                "value": "",
                "type": "path",
                "description": "Entity type"
              }
            ]
          },
          "docs": "Send entity limit increase request notification by Tenant Administrator to System administrators.\n\nAvailable for users with 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Get Notifications (getNotifications)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notifications",
            "params": [
              {
                "name": "pageSize",
                "value": "",
                "type": "query",
                "description": "Maximum amount of entities in a one page"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Sequence number of page starting from 0"
              },
              {
                "name": "textSearch",
                "value": "",
                "type": "query",
                "description": "Case-insensitive 'substring' filter based on notification subject or text"
              },
              {
                "name": "sortProperty",
                "value": "",
                "type": "query",
                "description": "Property of entity to sort by"
              },
              {
                "name": "sortOrder",
                "value": "",
                "type": "query",
                "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)"
              },
              {
                "name": "unreadOnly",
                "value": "",
                "type": "query",
                "description": "To search for unread notifications only"
              },
              {
                "name": "deliveryMethod",
                "value": "",
                "type": "query",
                "description": "Delivery method"
              }
            ]
          },
          "docs": "Returns the page of notifications for current user.\n\nYou 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. \n\nAvailable for any authorized user. \n\n**WebSocket API**:\n\nThere are 2 types of subscriptions: one for unread notifications count, another for unread notifications themselves.\n\nThe URI for opening WS session for notifications: `/api/ws/plugins/notificatio"
        },
        {
          "info": {
            "name": "Get Unread Notifications Count (getUnreadNotificationsCount)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notifications/unread/count",
            "params": [
              {
                "name": "deliveryMethod",
                "value": "",
                "type": "query",
                "description": "Delivery method"
              }
            ]
          },
          "docs": "Returns unread notifications count for chosen delivery method.\n\nAvailable for any authorized user. "
        },
        {
          "info": {
            "name": "Get Notification Requests (getNotificationRequests)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/requests",
            "params": [
              {
                "name": "pageSize",
                "value": "",
                "type": "query",
                "description": "Maximum amount of entities in a one page"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Sequence number of page starting from 0"
              },
              {
                "name": "textSearch",
                "value": "",
                "type": "query",
                "description": "Case-insensitive 'substring' filed based on the used template name"
              },
              {
                "name": "sortProperty",
                "value": "",
                "type": "query",
                "description": "Property of entity to sort by"
              },
              {
                "name": "sortOrder",
                "value": "",
                "type": "query",
                "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)"
              }
            ]
          },
          "docs": "Returns the page of notification requests submitted by users of this tenant or sysadmins.\n\nYou 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. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Get Notification Request by Id (getNotificationRequestById)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/request/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Fetches notification request info by request id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Delete Notification Request (deleteNotificationRequest)",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://demo.thingsboard.io/api/notification/request/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Deletes notification request by its id.\n\nIf the request has status `SENT` - all sent notifications for this request will be deleted. If it is `SCHEDULED`, the request will be cancelled.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Get Available Delivery Methods (getAvailableDeliveryMethods)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/deliveryMethods"
          },
          "docs": "Returns the list of delivery methods that are properly configured and are allowed to be used for sending notifications.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Delete Notification (deleteNotification)",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://demo.thingsboard.io/api/notification/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Deletes notification by its id.\n\nAvailable for any authorized user. "
        }
      ]
    },
    {
      "info": {
        "name": "notification-template-controller",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Save Notification Template (saveNotificationTemplate)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/template",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Creates or updates notification template.\n\nHere is an example of template to send notification via Web, SMS and Slack:\n```json\n{\n  \"name\": \"Greetings\",\n  \"notificationType\": \"GENERAL\",\n  \"configuration\": {\n    \"deliveryMethodsTemplates\": {\n      \"WEB\": {\n        \"enabled\": true,\n        \"subject\": \"Greetings\",\n        \"body\": \"Hi there, ${recipientTitle}\",\n        \"additionalConfig\": {\n          \"icon\": {\n            \"enabled\": true,\n            \"icon\": \"back_hand\",\n            \"color\": \"#757575"
        },
        {
          "info": {
            "name": "Get Notification Templates (getNotificationTemplates)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/templates",
            "params": [
              {
                "name": "pageSize",
                "value": "",
                "type": "query",
                "description": "Maximum amount of entities in a one page"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Sequence number of page starting from 0"
              },
              {
                "name": "textSearch",
                "value": "",
                "type": "query",
                "description": "Case-insensitive 'substring' filter based on template's name and notification type"
              },
              {
                "name": "sortProperty",
                "value": "",
                "type": "query",
                "description": "Property of entity to sort by"
              },
              {
                "name": "sortOrder",
                "value": "",
                "type": "query",
                "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)"
              },
              {
                "name": "notificationTypes",
                "value": "",
                "type": "query",
                "description": "Comma-separated list of notification types to filter the templates"
              }
            ]
          },
          "docs": "Returns the page of notification templates owned by sysadmin or tenant.\n\nYou 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. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Get Notification Template by Id (getNotificationTemplateById)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/template/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Fetches notification template by id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Delete Notification Template by Id (deleteNotificationTemplateById",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://demo.thingsboard.io/api/notification/template/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Deletes notification template by its id.\n\nThis template cannot be referenced by existing scheduled notification requests or any notification rules.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "List Slack Conversations (listSlackConversations)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/slack/conversations",
            "params": [
              {
                "name": "type",
                "value": "",
                "type": "query"
              },
              {
                "name": "token",
                "value": "",
                "type": "query",
                "description": "Slack bot token. If absent - system Slack settings will be used"
              }
            ]
          },
          "docs": "List available Slack conversations by type.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        }
      ]
    },
    {
      "info": {
        "name": "notification-target-controller",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Save Notification Target (saveNotificationTarget)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/target",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Creates or updates notification target.\n\nAvailable `configuration` types are `PLATFORM_USERS` and `SLACK`.\nFor `PLATFORM_USERS` the `usersFilter` must be specified. For tenant, there are following users filter types available: `USER_LIST`, `CUSTOMER_USERS`, `TENANT_ADMINISTRATORS`, `ALL_USERS`, `ORIGINATOR_ENTITY_OWNER_USERS`, `AFFECTED_USER`.\nFor sysadmin: `TENANT_ADMINISTRATORS`, `AFFECTED_TENANT_ADMINISTRATORS`, `SYSTEM_ADMINISTRATORS`, `ALL_USERS`.\n\nHere is an example of tenant-level notific"
        },
        {
          "info": {
            "name": "Get Recipients for Notification Target Config (getRecipientsForNotificationTargetConfig)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/target/recipients",
            "params": [
              {
                "name": "pageSize",
                "value": "",
                "type": "query",
                "description": "Maximum amount of entities in a one page"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Sequence number of page starting from 0"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Returns the page of recipients for such notification target configuration.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Get Notification Targets by Ids (getNotificationTargetsByIds)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/targets",
            "params": [
              {
                "name": "pageSize",
                "value": "",
                "type": "query",
                "description": "Maximum amount of entities in a one page"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Sequence number of page starting from 0"
              },
              {
                "name": "textSearch",
                "value": "",
                "type": "query",
                "description": "Case-insensitive 'substring' filed based on the target's name"
              },
              {
                "name": "sortProperty",
                "value": "",
                "type": "query",
                "description": "Property of entity to sort by"
              },
              {
                "name": "sortOrder",
                "value": "",
                "type": "query",
                "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)"
              },
              {
                "name": "notificationType",
                "value": "",
                "type": "query"
              },
              {
                "name": "ids",
                "value": "",
                "type": "query",
                "description": "Comma-separated list of uuids representing targets ids"
              }
            ]
          },
          "docs": "Returns the list of notification targets found by provided ids.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Get Notification Target by Id (getNotificationTargetById)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/target/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Fetches notification target by id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Delete Notification Target by Id (deleteNotificationTargetById)",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://demo.thingsboard.io/api/notification/target/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Deletes notification target by its id.\n\nThis target cannot be referenced by existing scheduled notification requests or any notification rules.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        }
      ]
    },
    {
      "info": {
        "name": "notification-rule-controller",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Save Notification Rule (saveNotificationRule)",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://demo.thingsboard.io/api/notification/rule",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Creates or updates notification rule. \n\nMandatory properties are `name`, `templateId` (of a template with `notificationType` matching to rule's `triggerType`), `triggerType`, `triggerConfig` and `recipientConfig`. Additionally, you may specify rule `description` inside of `additionalConfig`.\n\nTrigger type of the rule cannot be changed. Available trigger types for tenant: `ENTITY_ACTION`, `ALARM`, `ALARM_COMMENT`, `ALARM_ASSIGNMENT`, `DEVICE_ACTIVITY`, `RULE_ENGINE_COMPONENT_LIFECYCLE_EVENT`.\nFor"
        },
        {
          "info": {
            "name": "Get Notification Rules (getNotificationRules)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/rules",
            "params": [
              {
                "name": "pageSize",
                "value": "",
                "type": "query",
                "description": "Maximum amount of entities in a one page"
              },
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Sequence number of page starting from 0"
              },
              {
                "name": "textSearch",
                "value": "",
                "type": "query",
                "description": "Case-insensitive 'substring' filter based on rule's name"
              },
              {
                "name": "sortProperty",
                "value": "",
                "type": "query",
                "description": "Property of entity to sort by"
              },
              {
                "name": "sortOrder",
                "value": "",
                "type": "query",
                "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)"
              }
            ]
          },
          "docs": "Returns the page of notification rules.\n\nYou 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. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Get Notification Rule by Id (getNotificationRuleById)",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://demo.thingsboard.io/api/notification/rule/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Fetches notification rule info by rule's id.\nIn addition to regular notification rule fields, there are `templateName` and `deliveryMethods` in the response.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        },
        {
          "info": {
            "name": "Delete Notification Rule (deleteNotificationRule)",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://demo.thingsboard.io/api/notification/rule/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path"
              }
            ]
          },
          "docs": "Deletes notification rule by id.\nCancels all related scheduled notification requests (e.g. due to escalation table)\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority."
        }
      ]
    }
  ],
  "bundled": true
}