Developer guide: 9. Alerts, subscriptions, reports and exports
Alerts, subscriptions, scheduled reports, exports and share links.
9. Alerts, subscriptions, reports and exports
9.1 Insight alerts
An alert watches a saved insight and notifies when a rule is crossed. Alerts run on a schedule; simulate first, then create.
Method and path | Scope | Purpose |
|---|---|---|
|
| Replay a condition over past data: |
|
| Create |
|
| Evaluate now (answers the alert with |
|
| List alerts |
|
| PATCH |
|
| History: |
lc -X POST "$P/insights/$INSIGHT_ID/alerts/simulate" -d '{"condition":{"op":"below","threshold":1},"days":14}' | jq '{fires, resolves}'
ALERT_ID=$(lc -X POST "$P/insights/$INSIGHT_ID/alerts" -d '{"name":"Signups dropped","condition":{"op":"below","threshold":1,"hysteresis":0},
"check_interval":"hourly","channels":[{"type":"webhook"}]}' | jq -r .id)
lc -X POST "$P/insights/$INSIGHT_ID/alerts/$ALERT_ID/check" | jq '{state, last_checked_at, last_value}'condition.op is above, below, pct_up, pct_down, delta_up, delta_down with threshold; optional hysteresis (stops flapping), series (index) and breakdown (a breakdown value). Funnels use {"kind":"funnel_conversion",...}, retention {"kind":"retention",...}, and a trend can use {"kind":"anomaly","sensitivity":"medium"}. check_interval is every_1m, every_5m, every_15m, hourly, daily (default), weekly or monthly. Simulate answers {fires, resolves, points:[{at, value, measure, firing, transition}]}. A new alert starts ok with last_checked_at: null until its first scheduled pass or a check call. It then moves ok to firing (notify once, emit alert.fired) and back (alert.resolved).
Channels (channels, at most 10, others are 400): {"type":"email","to":"a@b.com"}, {"type":"slack","url":"https://hooks.slack.com/..."}, {"type":"teams","url":...}, {"type":"discord","url":...} (chat URLs are checked, sealed at rest and never returned), {"type":"webhook"} (fires your project webhooks subscribed to alert.fired / alert.resolved; with none it sends nothing external, so it is the safe choice for tests), and {"type":"account_team",...} (the people on the account's relationships, 8.7). The creator always also gets an in-app notification. flag_action is {flag_id, environment, action} and changes a flag when the alert fires. See Alerts on insights.
9.2 Subscriptions and digests
A subscription sends an insight, a dashboard, a digest or a web report on a schedule by email or Slack. These deliver real messages: use your own address or a test Slack webhook.
Method and path | Scope | Purpose |
|---|---|---|
|
| List; create |
|
| Update; delete |
|
| Deliver now ( |
|
| `{cron |
|
| Channels of the installed Slack app |
|
| What the weekly digest would suggest |
lc -X POST "$P/subscriptions/schedule-preview" -d '{"schedule":{"every":1,"unit":"week","time":"09:00","timezone":"Europe/Berlin","weekdays":[1]}}'
# {"next":["2026-11-16T08:00:00Z","2026-11-23T08:00:00Z","2026-11-30T08:00:00Z"]}
lc -X POST "$P/subscriptions" -d "{\"channel\":\"email\",\"insight_id\":\"$INSIGHT_ID\",\"recipients\":[\"me@your-company.test\"],\"cron\":\"0 9 * * 1\",\"title\":\"Weekly signups\"}"
lc -X POST "$P/subscriptions" -d '{"digest":true,"channel":"email","recipients":["me@your-company.test"],"schedule":{"every":1,"unit":"week","time":"09:00"}}'Give exactly one subject: insight_id, dashboard_id, digest: true, web_report: true or prompt (a question the assistant answers each time, at most 2000 characters, with prompt_window_days 1-365). channel is email (up to 20 recipients, or one target) or slack (target = incoming-webhook URL stored sealed, or a slack_channel from the installed app). A Slack target must be an https://hooks.slack.com/services/..., /workflows/... or /triggers/... URL; anything else is 400 with errors[] field target. Schedule: cron (five fields, UTC, at most hourly) or schedule {every, unit: day|week|month, time: "HH:MM", timezone?, weekdays?: [1,5], monthly?}. Other fields: title, message (max 1000), format (table default or pdf), ai_summary, insight_ids (dashboard: 1-20), variables. Each newly added email recipient gets a notice mail. The digest and web report are described in Weekly digest. Note: a Slack subscription accepts any https URL as target (an example.com URL was accepted at create time), so validate the URL yourself.
9.3 Reports (inbox) and signals
Signals are findings from any source (your scripts, scouts, Lucida itself). Signals with the same group key land in one inbox report that people triage.
Method and path | Scope | Purpose |
|---|---|---|
|
| Raise a signal |
|
| Inbox: |
| read / write | PATCH |
|
| Assign to yourself; release |
|
|
|
|
|
|
lc -X POST "$P/signals" -d '{"source":"web","finding":"Pricing page bounce rate doubled","dedupe_key":"pricing-bounce",
"priority":"P2","title":"Pricing bounce up","evidence":{"metric":"bounce_rate","from":0.31,"to":0.62},
"suggested_action":"Check the pricing experiment","tags":["web"]}' | jq '{id, state, priority, title}'
lc -X PATCH "$P/reports/$REPORT_ID" -d '{"state":"resolved","outcome":"fixed","pr_url":"https://example.com/pr/1"}'Signal body: source (friction, forms, flags, experiments, ingestion, web, or a scout name), finding, dedupe_key (same key while the report is open means the same signal, refreshed), optional title, group_key (defaults to dedupe_key), priority P0 to P4 (default P3; an open report keeps the most urgent), evidence, suggested_action, tags, account. It answers the report: {id, state, priority, title, sources, signal_count, tags, assignee_id, ...}. state is actionable, needs_input, snoozed, resolved or dismissed; resolved is final (409 on later edits). outcome is fixed, wont_fix, duplicate, not_reproducible or expected. Opening is capped per UTC day by report-settings (7.7): a 409 says the cap is reached.
9.4 Insight feed and notifications
The insight feed is a list of cards in the app (GET/POST {p}/insight-feed).
lc -X POST "$P/insight-feed" -d '{"kind":"note","title":"Pricing bounce up","body":"See the pricing dashboard","severity":"warning","dedupe_key":"pricing-bounce-feed","data":{"dashboard_id":"'$DASH_ID'"}}'
lc "$P/insight-feed?limit=10&include_dismissed=false"
lc -X POST "$P/insight-feed/$FEED_ID/dismiss" # 204severity is info, warning or critical; the same dedupe_key refreshes the card in place. GET needs insight:read; POST and dismiss need insight:write. Personal notifications (GET /v1/notifications, /unread-count, POST /v1/notifications/read-all, POST /v1/notifications/{id}/read) belong to a signed-in user: an account key gets 404 there.
9.5 Export schedules (batch exports)
Export schedules write a stream to your storage or warehouse on a timer. The full guide, with permissions per destination, is Batch exports. Reads need connector:read, writes connector:write.
Method and path | Purpose |
|---|---|
| List ( |
| PATCH only |
| Check a destination without saving (writes and removes a probe object). |
| Stop, restart |
| Run the next window now ( |
|
|
| Runs (`?kind=scheduled |
| Retry a failed run; cancel a queued or running one |
BODY='{"name":"events-s3","stream":"events","format":"jsonl.gz","interval_secs":3600,"chunk_secs":3600,
"destination":{"kind":"s3","endpoint":"https://s3.us-east-1.amazonaws.com","bucket":"my-exports","region":"us-east-1","prefix":"lucida"},
"credentials":{"dest":{"access_key":"AKIA...","secret_key":"..."}},"options":{}}'
lc -X POST "$P/export-schedules/test" -d "$BODY" # 422 when the destination refuses the probe
lc -X POST "$P/export-schedules" -d "$BODY"Cloudflare in front of lucidace.com replaces the body of any origin 502 or 504 with the plain text error code: 502, so on the public host read the status code, not the body (the service itself sends problem+json).
Required: name, stream, format, destination, interval_secs, chunk_secs, credentials, options (send {} if unused). stream is events, persons, sessions, groups, source_rows, query or replays; format is jsonl.gz or parquet. A bad body is 422 invalid export schedule with the reason. warehouse ({kind, params}) adds a load step. Options include include_events, exclude_events, key_template, max_file_mb, compression, manifest, consent_categories, consent_missing, apply_deletes, sensitive, query. Credentials are sealed on save and never returned: to rotate one, delete and recreate the schedule. Destination errors (the 422 of test, a run's error) show only the S3 Code: Message (for example AccessDenied: Access Denied), never the raw XML, and anything shaped like an AWS access key id is replaced by [redacted]. Delivery is at-least-once, so load idempotently. A failing schedule shows as export_failing in pipeline health.
9.6 Recommendations (recs)
Item-to-item and popularity recommendations for product pages, served through placements.
Method and path | Scope | Purpose |
|---|---|---|
|
| `{enabled, catalog_source: events |
|
| Upload a catalog: `{format: csv |
|
|
|
|
|
|
| read / write | Placements `{key, name, strategy, strategies?, limit, fallback: popular |
|
| Refresh the catalog and rebuild every placement's lists |
|
|
|
strategy is popular, trending, viewed_with, bought_with or recently_viewed. Build runs after you configure settings and send view and purchase events with the item id property; with no behaviour data the lists stay empty (items: []) even though the catalog is loaded.
lc -X PUT "$P/recs/settings" -d '{"enabled":true,"catalog_source":"feed","item_id_property":"item_id","view_event":"product_viewed","purchase_event":"purchase","lookback_days":30}'
lc -X POST "$P/recs/items/feed" -d '{"format":"json","data":"[{\"item_id\":\"sku-1\",\"name\":\"Mug\",\"price\":[9.5](/help/developer-guide-alerts-and-exports#95-export-schedules-batch-exports),\"category\":\"home\"}]"}'
lc -X POST "$P/recs/placements" -d '{"key":"pdp-similar","name":"Product page","strategy":"popular","limit":4,"fallback":"popular","exclude_anchor":true}'
lc -X POST "$P/recs/build" && lc "$P/recs/recommendations?placement=pdp-similar&item_id=sku-1"