Modify Alert

View as Markdown
### Modify an existing alert and re-arm it. **Available to:** All authenticated users **Environments:** Demo, Live **[Rate Limit](/api/authentication#request-rate-limits-and-time-penalties):** No endpoint-specific limit Updates an existing `Alert` identified by `alertId`. The alert must belong to the calling user. The server re-parses the supplied `expression` before applying changes; on success it replaces the alert's `expression`, `validUntil`, `triggerLimits`, and `message`, resets the `triggeredCounter` and clears any `failure`, sets `status` back to `Active`, and resumes watching the condition. The response returns the updated `alert`. Request fields: - `alertId` (required) — the `id` of the alert to modify, from [`createAlert`](/api/rest-api-endpoints/alerts/create-alert) or [`alertItem`](/api/rest-api-endpoints/alerts/alert-item). - `expression` (required) — the new condition, up to 4096 characters. - `validUntil` — optional new expiration time. - `triggerLimits` — optional new trigger limit (0–10). - `message` — optional new message text (up to 256 characters). Because a modify resets the trigger counter and reactivates the alert, it is equivalent to a [`resetAlert`](/api/rest-api-endpoints/alerts/reset-alert) that also changes the alert's parameters. If the new `expression` fails to parse, the existing alert is left unchanged and the response carries a non-empty `errorText`. If the parse succeeds but the update cannot be persisted, the server resumes watching the original alert and returns an `errorText` beginning with `"Cannot apply changes:"`. **Common Failure Scenarios** - The new `expression` is malformed or references an unsupported condition. - `alertId` does not exist or is not owned by the calling user. **Error Messages** | `errorText` | Trigger | |-------------|---------| | `"Cannot apply changes: ..."` | The `expression` parsed, but the update could not be saved; the original alert continues watching. | | Non-empty `errorText` | The request failed; the field describes the reason (most commonly an `expression` that could not be parsed). |

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
alertIdlongRequired
expressionstringRequired<=4096 characters
validUntildatetimeOptional
triggerLimitsintegerOptional0-10
messagestringOptional<=256 characters

Response

AlertResponse
errorTextstring<=8192 characters

Non-empty if the request failed

alertobject