---
title: "Create an alert on a metric"
method: POST
path: "/observability/v1/alerts/"
tags: ["observability"]
---

# Create an alert on a metric

`POST /observability/v1/alerts/`

## Request

- Base URL: `https://api.cekura.ai`
- URL: `https://api.cekura.ai/observability/v1/alerts/`
- Auth: one of:
  - API key in header `X-CEKURA-API-KEY`
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Create an alert that fires when a metric crosses a threshold. Three sub_types:

- `normal` — Failure alert. Fires per failing call. Only for binary metrics (eval_type starts with `binary_`) plus the latency / infrastructure / critical-deviation built-ins.
- `significant_change` — Trend alert. Fires when a numeric/continuous metric's rolling mean deviates from history. Pass `preset: "balanced"` (or `"conservative"` / `"aggressive"`) to skip manual std_multiplier / ewma_alpha / window_size math — the server expands the preset. Balanced is the safe default.
- `threshold` — Hard ceiling/floor. Fires when ≥ `min_breaches` of the last `window_size` evaluations cross `value`. Use for numeric metrics where the user has a known good range. Operator is `gt` | `lt` | `outside` ({low, high}).

**Slack delivery requires** `notifications.slack.workspace_id` (+ optional `channel_id`). Alerts with empty `notifications` are silent — fire counters still increment but no message is sent. Pick a workspace_id from `slack_workspaces_list`.

## Request body

- AlertCreate
  - `id` integer
  - `name` string, required: Alert name
  - `enabled` boolean: Enable/disable alert
  - `project` integer, required: Project this alert belongs to
  - `source_type` 'metric', required: Type of data source: metric, duration, call_volume, etc. * `metric` - Metric
  - `source_id` integer, nullable: ID of monitored object
  - `source` unknown
  - `threshold` unknown
  - `notifications` unknown
  - `preset` 'conservative' | 'balanced' | 'aggressive': Optional shorthand for trend alerts: 'conservative' | 'balanced' | 'aggressive'. Expands to std_multiplier / ewma_alpha / window_size. Explicit values in `source` or `threshold` override the preset. Ignored unless sub_type == 'significant_change'. Prefer it over setting those three by hand; 'balanced' is the safe default. * `conservative` - conservative * `balanced` - balanced * `aggressive` - aggressive

## Response `201`

- AlertCreate
  - `id` integer
  - `name` string, required: Alert name
  - `enabled` boolean: Enable/disable alert
  - `project` integer, required: Project this alert belongs to
  - `source_type` 'metric', required: Type of data source: metric, duration, call_volume, etc. * `metric` - Metric
  - `source_id` integer, nullable: ID of monitored object
  - `source` unknown
  - `threshold` unknown
  - `notifications` unknown
  - `preset` 'conservative' | 'balanced' | 'aggressive': Optional shorthand for trend alerts: 'conservative' | 'balanced' | 'aggressive'. Expands to std_multiplier / ewma_alpha / window_size. Explicit values in `source` or `threshold` override the preset. Ignored unless sub_type == 'significant_change'. Prefer it over setting those three by hand; 'balanced' is the safe default. * `conservative` - conservative * `balanced` - balanced * `aggressive` - aggressive

## Changes

- **2026-11-03** `a6fb6a739212`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cekura/apis/cekura-api/changes/observability/v1/alerts/post.md)

---

[API](https://skmtc.dev/cekura/apis/cekura-api.md) - [All operations](https://skmtc.dev/cekura/apis/cekura-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cekura/apis/cekura-api/revisions/a6fb6a739212?raw)
