Alerts

Test Alert Preferences

Fire a synthetic alert through every enabled channel.

Returns the per-channel success/error map so the settings UI can show the user what worked and what didn't. The synthetic alert is NOT persisted — this is a dry-run probe, not a real signal.

channel lets the settings UI fire ONE channel at a time — clicking "Test email" should not also POST to the user's webhook (which would noise up their Slack channel for no reason). Implemented by temporarily disabling the other channel on the in-memory prefs row before calling deliver_alert and restoring afterwards, so the dispatcher logic stays untouched and the saved row is unchanged.

UX: when no preferences row exists yet, we upsert one from the body (treating Test as Save+Test). This lets the user paste a webhook URL and immediately click Test without first hitting Save — the previous "save preferences first?" 404 was a confusing dead end.

post/api/alert-preferences/test

Request

  • Base URL: https://api.kolens.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.kolens.ai/api/alert-preferences/test
  • Auth: HTTP bearer

Query parameters

channelstring nullable

Restrict the probe to a single channel. Omit to test all enabled channels.

Headers

x-kolens-user-idstring nullable

Request body

email_enabledboolean nullable
email_tostring nullable
webhook_enabledboolean nullable
webhook_urlstring nullable
webhook_secretstring nullable
muted_typesstring[] nullable
rate_per_hourinteger nullable
preferred_localestring nullable

BCP-47 tag from the supported set: en | zh-CN | ja

rising_score_thresholdnumber nullable
rising_follower_pctnumber nullable
rising_follower_deltainteger nullable
rising_view_growth_pctnumber nullable
rising_lookback_daysinteger nullable

Response

Successful Response

object required

Changes

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