Skip to main content
POST

Authorizations

Authorization
string
header
required

Timbal API key. Obtain your API key from the Timbal platform settings. See Authentication for more information.

Path Parameters

org_id
string
required

Body

application/json

Body for POST /orgs/{org_id}/alarms.

channel
object
required

Channel: inline type + config, or reuse with { "id": <channel id> } (same org).

comparison
enum<string>
required
Available options:
gt,
gte,
lt,
lte
metric_name
string
required

Metric to watch, e.g. app.run.errors, deployment.health, org.credits.spend. The numerator when denominator_metric_name is set.

name
string
required
stat
string
required

Aggregation applied to each evaluation period. Percentiles run from p0.1 to p99.9 in tenths; equivalent spellings such as p95.0 are accepted and returned canonically as p95, while a finer value such as p95.05 is rejected rather than rounded. They are exact rather than interpolated from bins, so they are only available on app.run.duration_ms and cannot be used with denominator_metric_name.

Pattern: ^(avg|sum|count|min|max|p\d+(\.\d+)?)$
Example:

"p99"

threshold
number<double>
required
clear_threshold
number<double> | null

Hysteresis: once in alarm, a period only stops counting as breaching once it clears this value rather than threshold. Must sit on the non-breaching side of threshold — below it for gt/gte, above for lt/lte.

Fire at 0.05 and clear at 0.03, and a metric hovering on 5% produces one transition instead of one per swing. Without it the only defences against flapping are a longer period_seconds or a higher datapoints_to_alarm, both of which also delay the first detection.

datapoints_to_alarm
integer<int32>

Datapoints that must breach out of the last evaluation_periods.

denominator_metric_name
string | null

Turns the alarm into a ratio condition: each period's datapoint becomes metric_name / denominator_metric_name, read with the same dims, stat and period. threshold is then a rate — 0.05 for a 5% error rate, not 5.

Pair it with min_sample_count; see that field.

dims
null | object

Metric dimension filters. Omitted = aggregate across that dimension.

Not Copy since label is owned.

evaluation_periods
integer<int32>
min_sample_count
integer<int64>

Minimum denominator for a ratio period to count. Below it (or at zero) the period has no datapoint and follows missing_data.

Exists because ratios are meaningless on tiny samples: 1 error out of 1 run is 100%. Set it to the smallest traffic level you'd actually act on.

missing_data
null | enum<string>

Omit to get a policy chosen from the metric: ignore for trace.* (sparse — a gap is absence of data, not a recovery) and not_breaching for everything else.

Available options:
not_breaching,
breaching,
insufficient,
ignore
period_seconds
integer<int32>

Length of one evaluation period in seconds (multiple of 60, >= 60).

project_id
string | null

Scope the alarm to a project. Omit for an org-level alarm.

Response

Alarm and channel link created

channel_action
enum<string>
required

How the request was wired to NotificationChannels.

Available options:
linked,
reused,
created
channel_id
integer<int64>
required
id
integer<int64>
required