update #
Updates a list of alerts in a tenant index.
Returns an error if any of the specified alerts do not exist.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/alerts/:index
Method: PATCH
Body:
{
"alertIds": ["alert-id-1", "alert-id-2"],
"comment": "Updated status",
"status": "resolved",
"assignedTo": "user-id",
"type": "status-change"
}
Javascript #
kuzzle.query({
controller: 'alerts',
action: 'update',
index: '<index>',
body: {
alertIds: ['alert-id-1', 'alert-id-2'],
comment: 'Updated status',
status: 'resolved',
assignedTo: 'user-id',
type: 'status-change', // or 'assign-change'
},
});
Arguments #
Arguments | Type | Description |
---|---|---|
index | string | Index name where the alerts are located. |
Body Properties #
Arguments | Type | Description |
---|---|---|
alertIds | array | List of alert IDs to update. |
comment | string | Comment to add to the update. |
status | string | New status of the alerts (required for status-change ). |
assignedTo | string | User ID of the new assignee (required for assign-change ). |
type | string | Type of the update (status-change or assign-change ). |
Response #
The response contains the results of the update operation.
Example Response #
{
"errors": [
{
"_id": "alert-id-3",
"reason": "Alert not found"
}
],
"successes": [
{
"_id": "alert-id-1",
"_source": {
"status": "resolved",
"auditTrail": [
{
"type": "status-change",
"status": "resolved",
"user": {
"kuid": "user-id",
"fullName": "John Doe"
},
"timestamp": "2025-05-06T12:00:00Z",
"comment": "Updated status",
"assignedTo": "user-id"
}
],
"assignedTo": "user-id"
}
}
]
}
Update Properties #
Arguments | Type | Description |
---|---|---|
errors | array | List of alerts that failed to update, with reasons. |
successes | array | List of successfully updated alerts. |
status | string | Updated status of the alert. |
auditTrail | array | Audit trail of actions performed on the alert. |
assignedTo | string | User ID of the person assigned to the alert. |