---
title: "Enable, disable or change an alert rule"
method: POST
path: "/alert-rules/{rule_id}"
tags: ["Alerts"]
---

# Enable, disable or change an alert rule

`POST /alert-rules/{rule_id}`

## Request

- Base URL: `https://adslighthouse.com/api/v1`
- URL: `https://adslighthouse.com/api/v1/alert-rules/{rule_id}`
- Auth: HTTP bearer

Changes an alert rule: enabled (false pauses it: it creates no new alerts and undelivered ones are not sent), its destination (validated for the rule's channel) or its restrictions. For engines, devices and countries, a list replaces that restriction, null removes it and an omitted field keeps it. A summary_digest rule also takes cadence, weekday, hour and time_zone; omitted ones keep their stored value, including the time zone. Type and channel cannot change; create a new rule instead. Requires the write scope.

## Path parameters

- `rule_id` string, required: The alert rule id from list_alert_rules.

## Request body

- object
  - `enabled` boolean: false pauses the rule; true resumes it.
  - `target` string: New destination for the rule's channel. An empty string on an email rule notifies the account owner.
  - `engines` string[], nullable: Only observations from these search engines. Omit or null for every engine.
  - `devices` string[], nullable: Only observations on these devices. Omit or null for every device.
  - `countries` string[], nullable: Only observations in these ISO 3166-1 alpha-2 countries, such as US.
  - `cadence` 'daily' | 'weekly': summary_digest only: daily or weekly. Required when creating a summary.
  - `weekday` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday': summary_digest only: the day of a weekly summary. Default monday.
  - `hour` integer: summary_digest only: local delivery hour, 0 to 23. Default 8 (08:00).
  - `time_zone` string: summary_digest only: IANA time zone such as America/New_York. Defaults to the acting person's time zone when creating, and keeps the stored zone when updating.

## Response `200`

Enable, disable or change an alert rule

- object
  - `id` string, required
  - `project_id` string, nullable, required
  - `project_name` string, nullable, required
  - `brand_name` string, required
  - `type` 'competitor_new' | 'competitor_returning' | 'hijack_detected' | 'affiliate_detected' | 'ranking_drop' | 'nklg_re_enable' | 'ingestion_failed' | 'summary_digest', required
  - `type_label` string, required
  - `channel` 'email' | 'webhook' | 'slack', required
  - `destination` string, nullable, required: Email address, or the host of a webhook or Slack URL (the full URL is never returned). null for an email rule that goes to the account owner.
  - `enabled` boolean, required
  - `filters` object, nullable, required: Which observations the rule watches. null in a dimension means every value; values within a dimension combine with OR, dimensions with AND.
    - `engines` string[], nullable, required
    - `devices` string[], nullable, required
    - `countries` string[], nullable, required
  - `schedule` object, nullable, required: When a scheduled summary (type summary_digest) is sent. Each summary covers the complete local days before its delivery day: the day before (daily) or the seven days before (weekly).
    - `cadence` 'daily' | 'weekly', required
    - `weekday` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday', nullable, required: The day a weekly summary is sent; null for a daily summary.
    - `hour` integer, required: Local hour of delivery, 0 to 23, at minute 00.
    - `time_zone` string, required: The IANA time zone the hour and the covered days use, kept on the rule when someone else edits it.
    - `next_delivery_at` string, nullable, required: When the next summary is sent; null while the rule is paused.
  - `created_at` string, required
  - `request_id` string

## Other responses

- `400`: Invalid parameters, cursor or body.
- `401`: Missing, invalid, expired or revoked credential.
- `403`: The credential lacks the write scope, the plan does not include the API, or the allowance is used up.
- `404`: Unknown project, keyword or run in this account.
- `409`: The idempotency key was already used for a different request.
- `429`: Rate limit reached. Retry after the Retry-After seconds.
- `503`: The requested service or file is temporarily unavailable.

---

[API](https://skmtc.dev/adslighthouse/apis/ads-lighthouse-api.md) · [All operations](https://skmtc.dev/adslighthouse/apis/ads-lighthouse-api/llms.txt) · [OpenAPI document](https://skmtc.dev/adslighthouse/apis/ads-lighthouse-api/revisions/e1a4a40b11a9?raw)
