Create notification request (createNotificationRequest)
Processes notification request. Mandatory 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). Optionally, you can set sendingDelayInSec inside the additionalConfig field to schedule the notification.
For each enabled delivery method in the notification template, there must be a target in the targets list that supports this delivery method: if you chose WEB, EMAIL or SMS - there must be at least one target in targets of PLATFORM_USERS type. For SLACK delivery method - you need to chose at least one SLACK notification target.
Notification request object with PROCESSING status will be returned immediately, and the notification sending itself is done asynchronously. After all notifications are sent, the status of the request becomes SENT. Use getNotificationRequestById to see the notification request processing status and some sending stats.
Here is an example of notification request to one target using saved template:
{
"templateId": {
"entityType": "NOTIFICATION_TEMPLATE",
"id": "6dbc3670-e4dd-11ed-9401-dbcc5dff78be"
},
"targets": [
"320e3ed0-d785-11ed-a06c-21dd57dd88ca"
],
"additionalConfig": {
"sendingDelayInSec": 0
}
}
Available for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.
Request body
Example request
{
"tenantId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "TENANT"
},
"templateId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_TEMPLATE"
},
"template": {
"id": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_TEMPLATE"
},
"createdTime": 1746028547220,
"tenantId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "TENANT"
}
},
"info": {
"dashboardId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DASHBOARD"
},
"stateEntityId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DEVICE"
}
},
"originatorEntityId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DEVICE"
},
"ruleId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_RULE"
},
"id": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_REQUEST"
},
"createdTime": 1746028547220
}Response
OK
Example response
{
"tenantId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "TENANT"
},
"templateId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_TEMPLATE"
},
"template": {
"id": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_TEMPLATE"
},
"createdTime": 1746028547220,
"tenantId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "TENANT"
}
},
"info": {
"dashboardId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DASHBOARD"
},
"stateEntityId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DEVICE"
}
},
"originatorEntityId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "DEVICE"
},
"ruleId": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_RULE"
},
"id": {
"id": "784f394c-42b6-435a-983c-b7beff2784f9",
"entityType": "NOTIFICATION_REQUEST"
},
"createdTime": 1746028547220
}