---
title: "Create / toggle / delete alert rule"
method: POST
path: "/dashboard/alert-rules"
tags: ["Alerts"]
---

# Create / toggle / delete alert rule

`POST /dashboard/alert-rules`

## Request

- Base URL: `https://blockreq.com/api`
- URL: `https://blockreq.com/api/dashboard/alert-rules`
- Auth: HTTP bearer

A personal scope holds at most 20 alert rules; creating another returns 400 "alert_rule_limit_reached".

## Request body

- object
  - `action` 'create' | 'toggle' | 'delete', required
  - `type` 'usage_percent' | 'error_rate' | 'package_expiry' | 'balance_low' | 'ru_usage': Rule type for action "create". "ru_usage" is a deprecated alias of "usage_percent", stored as "usage_percent" and removed on 2027-01-01.
  - `threshold` number
  - `channel` string
  - `ruleId` number
  - `enabled` boolean
  - `label` string, nullable: Rule label for action "create", at most 64 characters.

## Response `200`

Result

- object
  - `code` number, required
  - `ok` boolean, required
  - `data` object, required
    - `ok` boolean, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Error

---

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