---
title: "Bulk Generate"
method: POST
path: "/api/v1/alert-rules/bulk/generate"
tags: ["alert-rules-bulk"]
---

# Bulk Generate

`POST /api/v1/alert-rules/bulk/generate`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/alert-rules/bulk/generate`
- Auth: none declared

Generate multiple alert rules from a filter and template.

Creates one rule per matching table. Transaction ensures all-or-nothing.

## Query parameters

- `asset_id` string, required: Asset UUID to create rules within

## Headers

- `Authorization` string

## Request body

- BulkGenerateRequest: Request to generate bulk alert rules.
  - `filter` BulkFilter, required: Combined filter for bulk table selection. At least one filter must be specified. Multiple filters are combined with OR.
    - `schema_filter` SchemaFilter: Filter for selecting tables by schema name pattern. Uses SQL LIKE syntax (% for any chars, _ for single char). Example: { "schema_pattern": "analytics%" }
      - `schema_pattern` string, required: Schema name pattern (SQL LIKE syntax: % for any, _ for single char)
    - `table_pattern_filter` TablePatternFilter: Filter for selecting tables by table name pattern. Uses SQL LIKE syntax (% for any chars, _ for single char). Must include at least one wildcard character. Example: { "table_pattern": "%_fact", "schema_pattern": "analytics" # Optional: restrict to specific schema }
      - `table_pattern` string, required: Table name pattern (SQL LIKE syntax, must include wildcard)
      - `schema_pattern` string, nullable: Optional schema pattern to restrict search
    - `tag_filter` TagFilter: Filter for selecting tables by tags. Example: { "tag_names": ["revenue", "orders"], "tag_categories": ["business"], "match_mode": "any" }
      - `tag_names` string[], nullable: List of tag names to match
      - `tag_categories` string[], nullable: List of tag categories to match
      - `match_mode` 'any' | 'all': 'any' for OR logic, 'all' for AND logic
    - `lineage_filter` LineageFilter: Filter for selecting tables by lineage relationships. Example: { "upstream_of": "dbt://models/gold/customer_summary", "downstream_of": null, "max_hops": 5 }
      - `upstream_of` string, nullable: Unique ID or table path to find upstream nodes of
      - `downstream_of` string, nullable: Unique ID or table path to find downstream nodes of
      - `max_hops` integer, nullable: Maximum hops to traverse (1-10, null=unlimited)
  - `rule_template` RuleTemplate, required: Template for generating alert rules. Supports variable substitution using {schema}, {table}, {full_name}.
    - `name_pattern` string, required: Name pattern with variables: {schema}, {table}, {full_name}
    - `description` string, nullable: Optional description pattern with variables
    - `event_types` string[], required: Event types to monitor
    - `severities` string[], nullable: Severity levels to match (null = all)
    - `cooldown_minutes` integer
    - `max_alerts_per_day` integer
    - `destination_ids` string[], required
  - `skip_existing` boolean: Skip tables that already have rules with same event_types
  - `is_dynamic` boolean: When true, rules will automatically include new tables matching the filter

## Response `200`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

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