Alerts

Edit an alert rule

Edit an alert's rule in a project the authenticated user can write to.

Requires MEMBER role or higher in the project's workspace (the write service decides). The patch is validated merged with the stored rule; an edit to any evaluated field resets the evaluation state, clears an open page, and re-arms a parked alert — the response reports the first two.

Args: request (Request): Incoming request (rate-limit plumbing). response (Response): Outgoing response (rate-limit plumbing). auth (AccountStampedAuth): Account-scope user auth (session token or CLI access JWT); its resolved user_id becomes the actor. alert_id (str): The alert to edit. payload (UpdateAlertRequest): The project and the rule fields to change. _live (None): Write-path liveness gate (blocks a revoked JWT session).

Returns: UpdateAlertResponse: The updated alert, the changed fields, and the state flags.

Raises: HTTPException: The write service's 400/403/404 verbatim, or a 503 when its response is ambiguous.

patch/api/v1/public/alerts/{alert_id}

Request

  • Base URL
    https://app.traceroot.ai
  • URL
    https://app.traceroot.ai/api/v1/public/alerts/{alert_id}
  • Auth
    HTTP bearer

Path parameters

alert_idstring required

Request body

aggregation'sum' | 'avg' | 'count' | 'max' | 'min' | 'p50' | 'p75' | 'p90' | 'p95' | 'p99' | 'uniq'
measurestring

A measure of the view, e.g. latency, cost, count

namestring
no_data_mode'HOLD' | 'ZERO' | 'NOTIFY'

What a window that measured nothing means

project_idstring required
thresholdnumber
threshold_operator'>' | '>=' | '<' | '<=' | '=' | '!='
view'SPANS'
window'1m' | '5m' | '10m' | '30m' | '1h' | '2h'

Response

Successful Response

changedstring[] required
page_clearedboolean

True when the alert was firing and the edit discarded that page

state_resetboolean

True when the edit voided the evaluation state and made the rule due now (any evaluated field changed, or the alert was resumed)

updatedboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.