alerts

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-alerts"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/4c09ada7-cd90-4938-baf3-c91bb0a3352f/social-card.svg?v=3e7ae33eec8b" alt="alerts" width="600" height="315"></a>
GEThttps://lucidace.com/v1/projects/{project_id}/alertsScope insight:read

Parameters

project_idstringpathrequired
insight_idstringquery
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/alerts"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of Alert, newest first
Example
{
  "data": [
    {
      "channels": [
        {}
      ],
      "check_interval": "string",
      "condition": {},
      "created_at": "2024-01-01T00:00:00Z",
      "enabled": true,
      "flag_action": {},
      "id": "string",
      "insight_id": "string",
      "last_checked_at": "2024-01-01T00:00:00Z",
      "last_error": "string",
      "last_value": 0,
      "name": "string",
      "project_id": "string",
      "snoozed_until": "2024-01-01T00:00:00Z",
      "state": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataAlert[]required
Show child parameters
channelsobject[]required
Channel list; Slack URLs are sealed and redacted by the API layer.
check_intervalstringrequired
every_1m | every_5m | every_15m | hourly | daily | weekly | monthly
conditionobjectrequired
{"op": "above|below|pct_up|pct_down|delta_up|delta_down", "threshold": f64, "hysteresis": f64, "series": int?, "breakdown": str?}
created_atstringrequired
enabledbooleanrequired
flag_actionobject
Flag action run when the alert starts firing: {flag_id, action: disable|enable|kill, environment?}.
idstringrequired
insight_idstringrequired
last_checked_atstring
last_errorstring
last_valuenumber
namestringrequired
project_idstringrequired
snoozed_untilstring
Notifications are suppressed until this time (evaluation continues).
statestringrequired
ok | firing | errored
next_cursorstring
404
DELETEhttps://lucidace.com/v1/projects/{project_id}/alerts/{id}Scope insight:write

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/alerts/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
403
404
PATCHhttps://lucidace.com/v1/projects/{project_id}/alerts/{id}Scope insight:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
channelsarray
check_intervalstring
every_1m | every_5m | every_15m | hourly | daily | weekly | monthly
conditionobject
enabledboolean
flag_actionFlagAction
Show child parameters
actionstringrequired
disable | enable | kill (kill sets the kill switch, overriding every condition).
environmentstring
Environment to act on; absent = the flag's base state.
flag_idstringrequired
namestring
snoozed_untilstring
Suppress notifications until this time (still evaluates); null clears the snooze.
{
  "channels": [
    {}
  ],
  "check_interval": "string",
  "condition": {},
  "enabled": true,
  "flag_action": {
    "action": "string",
    "environment": "string",
    "flag_id": "string"
  },
  "name": "string",
  "snoozed_until": "2024-01-01T00:00:00Z"
}

Code samples

cURL
curl -X PATCH "https://lucidace.com/v1/projects/{project_id}/alerts/{id}" \
  -H "Content-Type: application/json" \
  -d '{"channels":[{}],"check_interval":"string","condition":{},"enabled":true,"flag_action":{"action":"string","environment":"string","flag_id":"string"},"name":"string","snoozed_until":"2024-01-01T00:00:00Z"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "channels": [
    {}
  ],
  "check_interval": "string",
  "condition": {},
  "created_at": "2024-01-01T00:00:00Z",
  "enabled": true,
  "flag_action": {},
  "id": "string",
  "insight_id": "string",
  "last_checked_at": "2024-01-01T00:00:00Z",
  "last_error": "string",
  "last_value": 0,
  "name": "string",
  "project_id": "string",
  "snoozed_until": "2024-01-01T00:00:00Z",
  "state": "string"
}
Schema
channelsobject[]required
Channel list; Slack URLs are sealed and redacted by the API layer.
check_intervalstringrequired
every_1m | every_5m | every_15m | hourly | daily | weekly | monthly
conditionobjectrequired
{"op": "above|below|pct_up|pct_down|delta_up|delta_down", "threshold": f64, "hysteresis": f64, "series": int?, "breakdown": str?}
created_atstringrequired
enabledbooleanrequired
flag_actionobject
Flag action run when the alert starts firing: {flag_id, action: disable|enable|kill, environment?}.
idstringrequired
insight_idstringrequired
last_checked_atstring
last_errorstring
last_valuenumber
namestringrequired
project_idstringrequired
snoozed_untilstring
Notifications are suppressed until this time (evaluation continues).
statestringrequired
ok | firing | errored
400
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/alerts/{id}/eventsScope insight:read

Parameters

project_idstringpathrequired
idstringpathrequired
transitionsbooleanquery
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/alerts/{id}/events"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of AlertEvent, newest first
404
POSThttps://lucidace.com/v1/projects/{project_id}/insights/{id}/alertsScope insight:write

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
channelsobject[]required
[{"type":"email","to":..}, {"type":"slack","url":..}, {"type":"webhook"}]
check_intervalstring
every_1m | every_5m | every_15m | hourly | daily | weekly | monthly (default daily).
conditionobjectrequired
Threshold: {"op": "above|below|pct_up|pct_down|delta_up|delta_down", "threshold": number, "hysteresis"?: number, "series"?: int, "breakdown"?: string (a breakdown value), "breakdowns"?: [string] (one value per breakdown column, empty = any), "value_column"?: string}. delta_* compare the absolute change from the previous point. Funnel conversion in percent (steps funnel): {"kind": "funnel_conversion", "op": "below", "threshold": 20, "to_step"?: int}. Retention at period N in percent: {"kind": "retention", "op": "below", "threshold": 30, "period"?: int}. Anomaly (any trend insight): {"kind": "anomaly", "sensitivity"?: "low|medium|high"|number, "detectors"?: ["zscore|mad|iqr|iforest|knn|hbos|lof|pca|copod|ecod|ocsvm|llm"], "ensemble"?: "and|or", "series"?: int, "breakdown"?: string, "value_column"?: string}.
flag_actionFlagAction
Show child parameters
actionstringrequired
disable | enable | kill (kill sets the kill switch, overriding every condition).
environmentstring
Environment to act on; absent = the flag's base state.
flag_idstringrequired
namestringrequired
{
  "channels": [
    {}
  ],
  "check_interval": "string",
  "condition": {},
  "flag_action": {
    "action": "string",
    "environment": "string",
    "flag_id": "string"
  },
  "name": "string"
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/insights/{id}/alerts" \
  -H "Content-Type: application/json" \
  -d '{"channels":[{}],"check_interval":"string","condition":{},"flag_action":{"action":"string","environment":"string","flag_id":"string"},"name":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
403
404
POSThttps://lucidace.com/v1/projects/{project_id}/insights/{id}/alerts/simulateScope insight:read

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
conditionobjectrequired
The alert condition, as on create.
daysinteger
Days to replay, 1 to 365 (default 30).
{
  "condition": {},
  "days": 0
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/insights/{id}/alerts/simulate" \
  -H "Content-Type: application/json" \
  -d '{"condition":{},"days":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "days": 0,
  "fires": 0,
  "firing_points": 0,
  "from": "2024-01-01T00:00:00Z",
  "llm_skipped": true,
  "points": [
    {}
  ],
  "resolves": 0,
  "to": "2024-01-01T00:00:00Z"
}
Schema
daysintegerrequired
firesintegerrequired
Times it would have fired and resolved: each is one notification.
firing_pointsintegerrequired
Points spent firing.
fromstringrequired
llm_skippedbooleanrequired
The llm detector is not replayed (one model call per point); the others are.
pointsobject[]required
Every replayed point of the window with its state.
resolvesintegerrequired
tostringrequired
400
404
POSThttps://lucidace.com/v1/projects/{project_id}/insights/{insight_id}/alerts/{alert_id}/checkScope insight:write

Evaluate one alert now with the scheduler's own code (state, history, notifications).

Parameters

project_idstringpathrequired
insight_idstringpathrequired
alert_idstringpathrequired

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/insights/{insight_id}/alerts/{alert_id}/check"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

403
404
Updated