Skip to content
TriedDocs
Account

Update alert

Change some fields of an alert rule.

PATCHhttps://api.tried.com.au/alerts/{id}

Updates an alert rule. Send only the fields you want to change; omitted fields keep their values. Updating a rule does not change its state or evaluate it.

Request#

Field Type Required Description
id string Yes Alert ID, for example alert_3f9a1c7e2b8d4a6f0e1c5b92.

The body takes any of the fields from Create alert, all optional, with the same limits.

Example request#

curl -X PATCH https://api.tried.com.au/alerts/alert_3f9a1c7e2b8d4a6f0e1c5b92 \
  -H "Authorization: Bearer $TRIED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "threshold": 2000,
    "enabled": false
  }'
const res = await fetch("https://api.tried.com.au/alerts/alert_3f9a1c7e2b8d4a6f0e1c5b92", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "threshold": 2000,
    "enabled": false
  }),
});
const alert = await res.json();
import os, requests

res = requests.patch(
    "https://api.tried.com.au/alerts/alert_3f9a1c7e2b8d4a6f0e1c5b92",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
    json={
        "threshold": 2000,
        "enabled": False,
    },
)
alert = res.json()

Response#

200 OK

{
  "alert_id": "alert_3f9a1c7e2b8d4a6f0e1c5b92",
  "name": "High p90 latency",
  "metric": "e2e_latency_p90",
  "threshold_type": "absolute",
  "comparator": ">",
  "threshold": 2000,
  "window_minutes": 60,
  "frequency_minutes": 5,
  "agent_ids": [
    "agent_4b7e2c9a1f3d5e8b0c6a2d1f"
  ],
  "emails": [
    "ops@example.com"
  ],
  "webhook_url": "https://example.com/hooks/alerts",
  "enabled": false,
  "state": "triggered",
  "last_value": 1720,
  "last_checked_timestamp": 1792398600000,
  "created_timestamp": 1792395000000
}

Returns the updated alert.

Field Type Description
alert_id string Alert ID, prefixed alert_.
state string ok or triggered. Changes only when the rule is evaluated (by the scheduler or Evaluate alert).
last_value number or null Value from the last evaluation. For a relative rule this is the percent change against the previous window. null until the first evaluation.
last_checked_timestamp integer or null Unix ms of the last evaluation.
created_timestamp integer Unix ms when the rule was created.

The other fields echo the rule settings. See Create alert for what each one means.

Errors#

Status When
400 Body validation failed.
401 Missing or invalid API key.
403 The key's IP allowlist or scopes reject the request. This route needs the analytics scope. Dashboard users with the member role get The member role is read-only.
404 No alert with that ID in the workspace: Alert <id> not found.
429 Rate limit exceeded. See Rate limits.

See Errors for the body format.

Retell compatibility#

Retell's public API reference has no alerting endpoints, so this route has no Retell SDK equivalent.