Get #
Retrieves an alert from a tenant index.
Returns an error if the alert does not exist.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/alerts/:index/:_id
Method: GET
Javascript #
kuzzle.query({
controller: 'alerts',
action: 'get',
index: '<index>',
_id: '<alert-id>',
});
Arguments #
Arguments | Type | Description |
---|---|---|
index | string | Index name where the alert exists. |
id | string | Unique identifier of the alert to retrieve. |
Response #
The response contains the alert document.
Example Response #
{
"_id": "alert-id",
"_source": {
"alertRule": {
"_id": "alert-rule-id",
"_source": {
"name": "Temperature Alert",
"description": "Triggered when temperature exceeds threshold",
"linkedNotificationRules": [],
"scope": {
"collection": "measures",
"filters": [
{
"references": ["sensor-1"],
"model": "Sensor",
"measureSlots": ["temperature"]
}
]
},
"plannings": {
"days": {
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": true,
"sun": true
},
"range": {
"allDay": true,
"start": "00:00",
"end": "23:59"
},
"timezone": "UTC"
},
"rule": {
"type": "threshold",
"threshold": {
"field": "values.temperature",
"operator": "gt",
"value": 30,
"debounce": {
"down": 10,
"levels": [
{
"severity": "critical",
"delay": 5
}
]
}
}
}
}
},
"status": "active",
"activity": "ongoing",
"documents": {
"sourceIds": ["doc-1", "doc-2"],
"collection": "measures",
"asset": {
"model": "Sensor",
"reference": "sensor-1"
}
},
"severities": [
{
"severity": 2,
"timestamp": "2025-05-06T12:00:00Z"
}
],
"auditTrail": [
{
"activity": "created",
"comment": "Alert created",
"type": "system",
"user": {
"kuid": "user-id",
"fullName": "John Doe"
},
"status": "new",
"timestamp": "2025-05-06T12:00:00Z"
}
],
"assignedTo": "user-id",
"_kuzzle_info": {
"author": "user-id",
"createdAt": 1746437146491,
"updatedAt": 1746538120730,
"updater": "admin"
}
}
}
Alert Properties #
Arguments | Type | Description |
---|---|---|
alertRule | object | The alert rule associated with the alert. |
status | string | Current status of the alert. |
activity | string | Current activity status of the alert. |
documents | object | Documents related to the alert. |
severities | array | List of severities associated with the alert. |
auditTrail | array | Audit trail of actions performed on the alert. |
assignedTo | string | User ID of the person assigned to the alert. |
_kuzzle_info | object | Metadata about the alert's creation and updates. |