---
title: "Create an alert rule"
method: POST
path: "/v1/alert-rules"
tags: ["alert-rules"]
---

# Create an alert rule

`POST /v1/alert-rules`

## Request

- Base URL: `https://api.brixsignage.com`
- URL: `https://api.brixsignage.com/v1/alert-rules`
- Auth: HTTP bearer

Create an alert rule with a `name`, `trigger`, optional `config`, optional `enabled` flag, and optional `nodeId`. If the scope named in `config` does not resolve to an existing target, the request is refused rather than saved. A Microsoft Teams channel is also refused unless `config.teamsUrls` contains at least one valid Microsoft Teams Workflow HTTPS URL. The response shows each URL masked.

**Notes.**
- The 201 body is the row as written, not re-read: `nodeId` is absent when the create did not set one.

## Request body

- object
  - `name` string, required
  - `trigger` string, required
  - `config` AlertRuleConfig: The rule's trigger, scope and delivery settings. Other keys pass through unchanged.
    - `codes` string[]: Every trigger code the rule watches; the first is also `trigger`.
    - `severity` string
    - `scopeKind` string: `workspace`, `org_unit`, `location`, `screen_group` or `screen`.
    - `scopeId` string
    - `thresholds` object
    - `channels` string[]: `in-app`, `email`, `webhook`, `teams`.
    - `recipients` string[]: Email addresses, `role:` tokens and webhook URLs. Webhook URLs are Masked: a delivery URL is a credential (a Microsoft Teams workflow URL carries it in `sig=`), so every response shows the host and the last four characters only — `https://prod-12.westus.logic.azure.com/…?sig=••••a1b2`. On update, send a masked value back unchanged to keep the saved URL, or a full URL to replace it.
    - `teamsUrls` string[]: Microsoft Teams workflow URLs for the `teams` channel. Masked: a delivery URL is a credential (a Microsoft Teams workflow URL carries it in `sig=`), so every response shows the host and the last four characters only — `https://prod-12.westus.logic.azure.com/…?sig=••••a1b2`. On update, send a masked value back unchanged to keep the saved URL, or a full URL to replace it.
  - `enabled` boolean
  - `nodeId` string, nullable

## Response `201`

Success.

- object
  - `data` object, required
    - `id` string, required: Alert rule id.
    - `spaceId` string, required
    - `name` string, required
    - `trigger` string, required: The first trigger code, e.g. `connection-lost`.
    - `config` AlertRuleConfig, required: The rule's trigger, scope and delivery settings. Other keys pass through unchanged.
      - `codes` string[]: Every trigger code the rule watches; the first is also `trigger`.
      - `severity` string
      - `scopeKind` string: `workspace`, `org_unit`, `location`, `screen_group` or `screen`.
      - `scopeId` string
      - `thresholds` object
      - `channels` string[]: `in-app`, `email`, `webhook`, `teams`.
      - `recipients` string[]: Email addresses, `role:` tokens and webhook URLs. Webhook URLs are Masked: a delivery URL is a credential (a Microsoft Teams workflow URL carries it in `sig=`), so every response shows the host and the last four characters only — `https://prod-12.westus.logic.azure.com/…?sig=••••a1b2`. On update, send a masked value back unchanged to keep the saved URL, or a full URL to replace it.
      - `teamsUrls` string[]: Microsoft Teams workflow URLs for the `teams` channel. Masked: a delivery URL is a credential (a Microsoft Teams workflow URL carries it in `sig=`), so every response shows the host and the last four characters only — `https://prod-12.westus.logic.azure.com/…?sig=••••a1b2`. On update, send a masked value back unchanged to keep the saved URL, or a full URL to replace it.
    - `enabled` boolean, required
    - `nodeId` string, nullable
    - `createdAt` string, required: ISO-8601 timestamp (UTC).
    - `updatedAt` string, required: ISO-8601 timestamp (UTC).
    - `deletedAt` string, nullable, required: ISO-8601 timestamp (UTC).

## Other responses

- `401`: Missing, expired or revoked bearer token.
- `403`: The token lacks the permission this operation needs (see `x-brix-permission`).
- `404`: The location does not exist.
- `422`: `name` or `trigger` is missing, the scope target does not exist, or a Microsoft Teams URL is not a workflow URL.
- `5XX`: Server error. The body carries a `requestId` to quote to support.

---

[API](https://skmtc.dev/brixsignage/apis/brix-api.md) · [All operations](https://skmtc.dev/brixsignage/apis/brix-api/llms.txt) · [OpenAPI document](https://skmtc.dev/brixsignage/apis/brix-api/revisions/7c2741bcdb16?raw)
