Passer au contenu principal
POST
ClickStack: Create Alert

Autorisations

Authorization
string
header
requis

Use key ID and key secret obtained in ClickHouse Cloud console: https://clickhouse.com/docs/cloud/manage/openapi

Paramètres de chemin

organizationId
string<uuid>
requis

ID of the organization that owns the service.

serviceId
string<uuid>
requis

ID of the ClickStack service.

Corps

application/json
threshold
number
requis

Threshold value for triggering the alert. For between and not_between threshold types, this is the lower bound.

Exemple:

100

interval
enum<string>
requis

Evaluation interval for the alert. 30s requires the 30s alert interval feature to be enabled for your team. Anomaly alerts (detectionMode "anomaly") support only 5m, 15m, 30m, and 1h; other intervals are rejected with 400.

Options disponibles:
30s,
1m,
5m,
15m,
30m,
1h,
6h,
12h,
1d
Exemple:

"1h"

thresholdType
enum<string>
requis

Threshold comparison direction.

Options disponibles:
above,
below,
above_exclusive,
below_or_equal,
equal,
not_equal,
between,
not_between
Exemple:

"above"

dashboardId
string | null

Dashboard ID for tile-based alerts.

Exemple:

"65f5e4a3b9e77c001a567890"

tileId
string | null

Tile ID for tile-based alerts. Must be a line, stacked bar, or number type tile.

Exemple:

"65f5e4a3b9e77c001a901234"

savedSearchId
string | null

Saved search ID for saved_search alerts.

Exemple:

"65f5e4a3b9e77c001a345678"

groupBy
string | null

Group-by key for saved search alerts.

Exemple:

"ServiceName"

chartConfig
object
thresholdMax
number | null

Upper bound for between and not_between threshold types. Required when thresholdType is between or not_between, must be >= threshold.

Exemple:

500

scheduleOffsetMinutes
integer | null

Offset from the interval boundary in minutes. For example, 2 with a 5m interval evaluates windows at :02, :07, :12, etc. (UTC).

Exemple:

2

scheduleStartAt
string<date-time> | null

Absolute UTC start time anchor. Alert windows start from this timestamp and repeat every interval.

Exemple:

"2026-02-08T10:00:00.000Z"

source
enum<string>

Alert source type (tile-based or saved search).

Options disponibles:
saved_search,
tile,
inline
Exemple:

"tile"

channel
object
channels
object[]

Notification channels to trigger when the alert fires or resolves. Between 1 and 10 channels; duplicates are rejected.

Required array length: 1 - 10 elements
name
string | null

Alert name template (Handlebars), rendered as the notification title. When omitted, a default title is generated from the display name, value and threshold.

Exemple:

"Errors for {{group}} hit {{value}}"

displayName
string | null

Display name shown in the alerts list and in notification titles. Defaults to the name of the referenced saved search, dashboard tile, or inline chart when omitted or null.

Exemple:

"Checkout error spike"

tags
string[]

Tags for the alert. Defaults to the tags of the referenced saved search or dashboard when omitted or null; inline alerts have no parent to inherit from and default to an empty list.

Exemple:
message
string | null

Alert message template.

Exemple:

"Test Alert Message"

note
string | null

Freeform note for the alert. Supports markdown formatting.

Exemple:

"Threshold raised from 50 to 100 on 2026-01-15. See [runbook](https://wiki.example.com/runbook)."

numConsecutiveWindows
integer | null

Fire the alert only after its condition has been met for this many consecutive evaluation windows. While the condition is met but fewer than this many consecutive windows have violated, the alert is in the PENDING state.

Exemple:

3

renotifyIntervalMinutes
integer | null

While the alert keeps firing, repeat its notification at most once every this many minutes. Omit or set to null to notify on every evaluation. The alert only notifies when it is evaluated, so a value below its interval has no effect. A resolve notification is always sent when the alert returns to OK. Ignored for anomaly alerts, which notify once per episode.

Exemple:

60

Réponse

Successful response

status
number

HTTP status code.

Exemple:

200

requestId
string<uuid>

Unique id assigned to every request. UUIDv4

result
object