---
title: "Create an alert (two-step; the preview runs the source once on live data)"
method: POST
path: "/api/orgs/{orgId}/alerts"
tags: ["reports"]
---

# Create an alert (two-step; the preview runs the source once on live data)

`POST /api/orgs/{orgId}/alerts`

## Request

- Base URL: `https://api.wizbi.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.wizbi.ai/api/orgs/{orgId}/alerts`
- Auth: none declared

A connector tool + a closed condition + a timing + a send policy. The preview shows the current value and whether the engine would raise now; nothing is stored until confirm.

## Path parameters

- `orgId` string, required

## Request body

- CreateAlertBody
  - `title` string, required
  - `source` AlertSource, required
    - `tool` string, required: A read-only tool of a connected source, as the owner has it.
    - `connector` string, nullable
    - `args` object
    - `value_path` string, nullable: Dot path to the number; absent = the first row's measure.
    - `rows_path` string, nullable: Dot path to the list counted as rows; absent = the largest list.
  - `condition` union, required: threshold (the value vs a bound) · delta_wow (week-over-week, confirmed by the median) · rows (at least N rows). Evaluated by the engine, never a model.
    - object
      - `kind` 'threshold', required
      - `op` 'gt' | 'gte' | 'lt' | 'lte', required
      - `value` number, required
    - object
      - `kind` 'delta_wow', required
      - `direction` 'up' | 'down' | 'any'
      - `pct` number, required
    - object
      - `kind` 'rows', required
      - `minRows` integer, required
  - `severity` 'low' | 'medium' | 'high'
  - `policy` AlertPolicy: ISA-18.2, adapted: fired checks in a row before raising (onDelay), clear checks before clearing (offDelay), "back to normal" line, reminder interval for an unacknowledged episode, messages per day, quiet hours (non-high messages wait).
    - `onDelay` integer
    - `offDelay` integer
    - `notifyClear` boolean
    - `renotifyAfterH` integer
    - `dailyCap` integer
    - `quietHours` object, nullable
      - `from` integer, required
      - `to` integer, required
  - `once` boolean
  - `frequency` 'once' | 'dates' | 'every_minutes' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'custom', required
  - `at` string: once: local "YYYY-MM-DDTHH:MM" in the caller's zone.
  - `in_minutes` integer: once, instead of `at`: minutes from now.
  - `every_minutes` integer: every_minutes: 15, 20, 30 or 45.
  - `every_hours` integer: hourly: every N hours (1,2,3,4,6,8,12).
  - `minute` integer: Minute past the hour, multiple of 5.
  - `hour` integer: daily/weekly/monthly: hour of day 0-23.
  - `weekday` integer: weekly: 0 = Sunday … 6 = Saturday.
  - `day_of_month` integer: monthly: 1-31 (29-31 fall back to a short month's last day).
  - `times` string[]: custom: "HH:MM".
  - `month_days` integer[]
  - `months` integer[]
  - `nth_weekdays` string[]: custom: "n:weekday" ("1:0" = first Sunday, "-1:5" = last Friday).
  - `every_days` integer: custom: every N days.
  - `every_weeks` integer: custom: every N weeks.
  - `anchor_date` string
  - `dates` string[]
  - `start_date` string, nullable
  - `end_date` string, nullable
  - `max_runs` integer: Stop after this many deliveries (0 clears).
  - `skip_holidays` boolean
  - `from_hour` integer: every_minutes/hourly: first hour of the window.
  - `to_hour` integer: every_minutes/hourly: last hour of the window (inclusive).
  - `days` integer[]
  - `timezone` string: IANA zone for this schedule.
  - `destination` string
  - `born_from` string
  - `confirm` boolean: false (default) = preview, nothing changes; true = act.

## Response `200`

Preview, or the created alert.

- AlertAnswer

## Other responses

- `400`: Invalid request.
- `401`: No context.
- `403`: Forbidden.
- `404`: Not found.

---

[API](https://skmtc.dev/wizbi/apis/wizbi-core-api.md) · [All operations](https://skmtc.dev/wizbi/apis/wizbi-core-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wizbi/apis/wizbi-core-api/revisions/5a47416c82ec?raw)
